ext/revdispatch/libdispatch-0.1/src/ev_http.cc in evdispatch-0.2.5 vs ext/revdispatch/libdispatch-0.1/src/ev_http.cc in evdispatch-0.2.6
- old
+ new
@@ -21,22 +21,22 @@
switch(rc) {
case CURLM_CALL_MULTI_PERFORM:
printf("curlm:perform: %s\n", curl_multi_strerror(rc) );
break;
case CURLM_OK:
-// printf("curlm:ok\n");
+ //printf("curlm:ok\n");
break;
case CURLM_BAD_HANDLE:
printf("curlm:bad handle: %s\n", curl_multi_strerror(rc) );
break;
case CURLM_BAD_EASY_HANDLE:
printf("curlm:bad easy handle: %s\n", curl_multi_strerror(rc) );
break;
case CURLM_OUT_OF_MEMORY:
printf("curlm:oh shit out of memory: %s\n", curl_multi_strerror(rc) );
break;
- case CURLM_INTERNAL_ERROR:
+ //case CURLM_INTERNAL_ERROR:
printf("curlm:oh shit internal error: %s\n", curl_multi_strerror(rc) );
break;
case CURLM_BAD_SOCKET:
printf("curlm:bad socket: %s\n", curl_multi_strerror(rc) );
break;
@@ -101,11 +101,11 @@
}
switch( action ){
case CURL_POLL_REMOVE: // (4) unregister
// make sure we clear it out
- //printf( " del sock: 0x%X\n", sockinfo );
+// printf( " del sock: 0x%X\n", sockinfo );
curl_multi_assign(client->m_handle, sock, NULL);
sockinfo->finish();
delete sockinfo;
client->check_handles();
break;
@@ -117,10 +117,11 @@
case CURL_POLL_OUT: // (2) register, interested in write readiness
// printf("out\n");
case CURL_POLL_INOUT: // (3) register, interested in both read and write readiness
// printf("inout\n");
default:
+// printf("set action: %d\n", action );
sockinfo->set_sock( sock, e, action );
client->check_handles();
break;
}
return 0;
@@ -315,14 +316,16 @@
if( m_client ) {
do {
rc = curl_multi_socket_all( m_client->m_handle, &m_client->m_active );
} while( rc == CURLM_CALL_MULTI_PERFORM && m_client );
}
- // XXX: it's really strange that m_client could be 0x0 all of a sudden here... but that's currently what must be happening
- // in order for the final return code to be CURLM_CALL_MULTI_PERFORM.
if( m_client ) {
m_client->check_handles();
+ }else {
+ // XXX: it's really strange that m_client could be 0x0 all of a sudden here... but that's currently what must be happening
+ // in order for the final return code to be CURLM_CALL_MULTI_PERFORM.
+ printf("m_client went 0x0\n");
}
multi_error_report(rc);
return (rc == CURLM_OK || rc == CURLM_CALL_MULTI_PERFORM);
}
@@ -370,17 +373,19 @@
long val = atoi(value.c_str());
curl_easy_setopt( m_handle, val_type, val );
}
else if( val_type >= CURLOPTTYPE_OBJECTPOINT && val_type < CURLOPTTYPE_FUNCTIONPOINT ) {
if( key == "post" ) {
- printf( "set %s as str, with value: %s\n", key.c_str(), value.c_str() );
+// printf( "set %s as str, with value: %s\n", key.c_str(), value.c_str() );
// enable HTTP POST
curl_easy_setopt( m_handle, CURLOPT_POST, 1 );
// set the buffer size to copy
curl_easy_setopt( m_handle, CURLOPT_POSTFIELDSIZE, value.length() );
+ curl_easy_setopt( m_handle, CURLOPT_POSTFIELDS, value.c_str() );
// copy the buffer
curl_easy_setopt( m_handle, CURLOPT_COPYPOSTFIELDS, value.c_str() );
// printf("setup easy handle to perform a post\n");
+// curl_easy_setopt( m_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
}
else {
curl_easy_setopt( m_handle, val_type, value.c_str() );
}
}