-void SwiftProgressCallback (int transfer, bin64_t bin) {
- for (int httpc=0; httpc<conn_count; httpc++)
- if (http_conns[httpc].transfer==transfer) {
- if (bin.offset()<<10==http_conns[httpc].offset)
- swift::Listen3rdPartySocket
- (http_conns[httpc].sink,NULL,MayWriteCallback,ErrorCallback);
- }
+void HttpGwSwiftProgressCallback (int transfer, bin64_t bin) {
+ for (int httpc=0; httpc<http_gw_reqs_open; httpc++)
+ if (http_requests[httpc].transfer==transfer)
+ if ( (bin.offset()<<10) == http_requests[httpc].offset ) {
+ socket_callbacks_t maywrite_callbacks
+ (http_requests[httpc].sink,NULL,HttpGwMayWriteCallback,HttpGwCloseConnection);
+ Listen3rdPartySocket (maywrite_callbacks);
+ }
+}
+
+
+void HttpGwFirstProgressCallback (int transfer, bin64_t bin) {
+ printf("200 OK\r\n");
+ printf("Content-Length: value\r\n");
+ swift::RemoveProgressCallback(transfer,&HttpGwFirstProgressCallback);
+ swift::AddProgressCallback(transfer,&HttpGwSwiftProgressCallback);
+ HttpGwSwiftProgressCallback(transfer,bin);