@@ -1050,7 +1050,7 @@ class THttpMonAuthorizedActorRequest : public TActorBootstrapped<THttpMonAuthori
1050
1050
return ;
1051
1051
}
1052
1052
}
1053
- Send ( new IEventHandle (Fields. Handler , SelfId (), Event-> ReleaseBase (). Release (), IEventHandle::FlagTrackDelivery, Event-> Cookie ) );
1053
+ SendRequest ( );
1054
1054
Become (&THttpMonAuthorizedActorRequest::StateWork);
1055
1055
}
1056
1056
@@ -1150,17 +1150,17 @@ class THttpMonAuthorizedActorRequest : public TActorBootstrapped<THttpMonAuthori
1150
1150
ReplyErrorAndPassAway (Ydb::StatusIds::UNAUTHORIZED, issues, true );
1151
1151
}
1152
1152
1153
- void SendRequest (const NKikimr::NGRpcService::TEvRequestAuthAndCheckResult& result) {
1153
+ void SendRequest (const NKikimr::NGRpcService::TEvRequestAuthAndCheckResult* result = nullptr ) {
1154
1154
NHttp::THttpIncomingRequestPtr request = Event->Get ()->Request ;
1155
1155
if (Authorizer) {
1156
- TString user = result. UserToken ? result. UserToken ->GetUserSID () : " anonymous" ;
1156
+ TString user = result-> UserToken ? result-> UserToken ->GetUserSID () : " anonymous" ;
1157
1157
ALOG_NOTICE (NActorsServices::HTTP, (request->Address ? request->Address ->ToString () : " " )
1158
1158
<< " " << user
1159
1159
<< " " << request->Method
1160
1160
<< " " << request->URL );
1161
1161
}
1162
- if (result. UserToken ) {
1163
- Event->Get ()->UserToken = result. UserToken ->GetSerializedToken ();
1162
+ if (result && result-> UserToken ) {
1163
+ Event->Get ()->UserToken = result-> UserToken ->GetSerializedToken ();
1164
1164
}
1165
1165
Send (new IEventHandle (Fields.Handler , SelfId (), Event->ReleaseBase ().Release (), IEventHandle::FlagTrackDelivery, Event->Cookie ));
1166
1166
@@ -1190,7 +1190,7 @@ class THttpMonAuthorizedActorRequest : public TActorBootstrapped<THttpMonAuthori
1190
1190
return ReplyErrorAndPassAway (result);
1191
1191
}
1192
1192
if (IsTokenAllowed (result.UserToken .Get (), Fields.AllowedSIDs )) {
1193
- SendRequest (result);
1193
+ SendRequest (& result);
1194
1194
} else {
1195
1195
return ReplyForbiddenAndPassAway (" SID is not allowed" );
1196
1196
}
@@ -1204,8 +1204,17 @@ class THttpMonAuthorizedActorRequest : public TActorBootstrapped<THttpMonAuthori
1204
1204
}
1205
1205
1206
1206
void Handle (NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk::TPtr& ev) {
1207
- Send (Event->Sender , new NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk (ev->Get ()->DataChunk ), 0 , Event->Cookie );
1208
- if (ev->Get ()->DataChunk && ev->Get ()->DataChunk ->IsEndOfData ()) {
1207
+ bool endOfData = false ;
1208
+ if (ev->Get ()->DataChunk ) {
1209
+ Send (Event->Sender , new NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk (ev->Get ()->DataChunk ), 0 , Event->Cookie );
1210
+ if (ev->Get ()->DataChunk ->IsEndOfData ()) {
1211
+ endOfData = true ;
1212
+ }
1213
+ } else if (ev->Get ()->Error ) {
1214
+ Send (Event->Sender , new NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk (ev->Get ()->Error ), 0 , Event->Cookie );
1215
+ endOfData = true ;
1216
+ }
1217
+ if (endOfData) {
1209
1218
PassAway ();
1210
1219
}
1211
1220
}
@@ -1225,7 +1234,7 @@ class THttpMonAuthorizedActorRequest : public TActorBootstrapped<THttpMonAuthori
1225
1234
hFunc (NHttp::TEvHttpProxy::TEvHttpOutgoingResponse, Handle);
1226
1235
hFunc (NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk, Handle);
1227
1236
hFunc (NHttp::TEvHttpProxy::TEvSubscribeForCancel, Handle);
1228
- hFunc (NHttp::TEvHttpProxy::TEvRequestCancelled, Handle)
1237
+ hFunc (NHttp::TEvHttpProxy::TEvRequestCancelled, Handle);
1229
1238
}
1230
1239
}
1231
1240
};
0 commit comments