Skip to content
Snippets Groups Projects
Commit b19d81d2 authored by anta999's avatar anta999
Browse files

test1

parent 4db07276
No related branches found
No related tags found
No related merge requests found
......@@ -259,7 +259,7 @@ void dap_http_folder_headers_write( dap_http_client_t *cl_ht, void * arg)
}
else {
cl_ht->reply_status_code=Http_Status_NotFound;
cl_ht->client->signal_close=true;
cl_ht->client->flags |= DAP_SOCK_SIGNAL_CLOSE;
log_it(L_WARNING,"Can't detect MIME type of %s file: %s",cl_ht_file->local_path,magic_error(up_folder->mime_detector));
}
}
......@@ -304,7 +304,10 @@ void dap_http_folder_data_write(dap_http_client_t * cl_ht, void * arg)
//strncat(cl_ht->client->buf_out+cl_ht->client->buf_out_size,"\r\n",sizeof(cl_ht->client->buf_out));
fclose(cl_ht_file->fd);
dap_client_remote_ready_to_write(cl_ht->client,false);
cl_ht->client->signal_close=!cl_ht->keep_alive;
if ( !cl_ht->keep_alive )
cl_ht->client->flags |= DAP_SOCK_SIGNAL_CLOSE;
cl_ht->state_write=DAP_HTTP_CLIENT_STATE_NONE;
}
}
......
......@@ -495,7 +495,7 @@ void dap_http_simple_data_write( dap_http_client_t *a_http_client, void *a_arg )
if ( !cl_st->reply ) {
a_http_client->client->signal_close = true;
a_http_client->client->flags |= DAP_SOCK_SIGNAL_CLOSE;
log_it( L_WARNING, "No reply to write, close connection" );
return;
......@@ -508,7 +508,7 @@ void dap_http_simple_data_write( dap_http_client_t *a_http_client, void *a_arg )
if ( cl_st->reply_sent >= a_http_client->out_content_length ) {
log_it(L_INFO, "All the reply (%u) is sent out", a_http_client->out_content_length );
//cl_ht->client->signal_close=cl_ht->keep_alive;
a_http_client->client->signal_close = true;
a_http_client->client->flags |= DAP_SOCK_SIGNAL_CLOSE;
//dap_client_ready_to_write(cl_ht->client,false);
}
......
......@@ -570,7 +570,7 @@ void dap_http_client_write( dap_client_remote_t * cl, void *arg )
log_it( L_DEBUG, "Nothing to output" );
cl_ht->state_write = DAP_HTTP_CLIENT_STATE_NONE;
dap_client_remote_ready_to_write( cl, false );
cl->signal_close = true;
cl->flags |= DAP_SOCK_SIGNAL_CLOSE;
}
dap_client_remote_ready_to_read( cl, true );
}
......
......@@ -346,10 +346,10 @@ static void* dap_http_client_thread(void * arg)
rc = 0;
if(maxfd == -1) {
log_it(L_DEBUG, "Waiting for signal");
// log_it(L_DEBUG, "Waiting for signal");
pthread_cond_wait(&m_curl_cond,&m_curl_mutex);
} else {
log_it(L_DEBUG, "Selecting stuff");
// log_it(L_DEBUG, "Selecting stuff");
/* Note that on some platforms 'timeout' may be modified by select().
If you need access to the original value save a copy beforehand. */
rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment