Apply patch from Kaori. Thanks.
This commit is contained in:
parent
7e6c287d78
commit
f26b96dd5c
|
@ -5,6 +5,9 @@ What's New for OpenJPIP
|
||||||
! : changed
|
! : changed
|
||||||
+ : added
|
+ : added
|
||||||
|
|
||||||
|
December 22, 2011
|
||||||
|
* [kaori] fixed auxtrans_manager to enable MAC
|
||||||
|
|
||||||
November 30, 2011
|
November 30, 2011
|
||||||
+ [kaori] TCP return (http-tcp) implemented
|
+ [kaori] TCP return (http-tcp) implemented
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,10 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "auxtrans_manager.h"
|
#include "auxtrans_manager.h"
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef _WIN32
|
||||||
#include <pthread.h>
|
|
||||||
#else
|
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
#else
|
||||||
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SERVER
|
#ifdef SERVER
|
||||||
|
@ -94,20 +94,21 @@ aux_response_param_t * gene_auxresponse( bool istcp, auxtrans_param_t auxtrans,
|
||||||
|
|
||||||
void delete_auxresponse( aux_response_param_t **auxresponse);
|
void delete_auxresponse( aux_response_param_t **auxresponse);
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
void * aux_streaming( void *arg);
|
#ifdef _WIN32
|
||||||
#else
|
|
||||||
unsigned __stdcall aux_streaming( void *arg);
|
unsigned __stdcall aux_streaming( void *arg);
|
||||||
|
#else
|
||||||
|
void * aux_streaming( void *arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void send_responsedata_on_aux( bool istcp, auxtrans_param_t auxtrans, char cid[], void *data, int datalen, int maxlenPerFrame)
|
void send_responsedata_on_aux( bool istcp, auxtrans_param_t auxtrans, char cid[], void *data, int datalen, int maxlenPerFrame)
|
||||||
{
|
{
|
||||||
aux_response_param_t *auxresponse;
|
aux_response_param_t *auxresponse;
|
||||||
#ifdef __linux__
|
#ifdef _WIN32
|
||||||
|
unsigned int threadId;
|
||||||
|
#else
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
int status;
|
int status;
|
||||||
#else
|
|
||||||
unsigned int threadId;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( istcp){
|
if( istcp){
|
||||||
|
@ -118,14 +119,14 @@ void send_responsedata_on_aux( bool istcp, auxtrans_param_t auxtrans, char cid[]
|
||||||
|
|
||||||
auxresponse = gene_auxresponse( istcp, auxtrans, cid, data, datalen, maxlenPerFrame);
|
auxresponse = gene_auxresponse( istcp, auxtrans, cid, data, datalen, maxlenPerFrame);
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef _WIN32
|
||||||
status = pthread_create( &thread, NULL, &aux_streaming, auxresponse);
|
|
||||||
if( status != 0)
|
|
||||||
fprintf( FCGI_stderr,"ERROR: pthread_create() %s",strerror(status));
|
|
||||||
#else
|
|
||||||
auxresponse->hTh = (HANDLE)_beginthreadex( NULL, 0, &aux_streaming, auxresponse, 0, &threadId);
|
auxresponse->hTh = (HANDLE)_beginthreadex( NULL, 0, &aux_streaming, auxresponse, 0, &threadId);
|
||||||
if( auxresponse->hTh == 0)
|
if( auxresponse->hTh == 0)
|
||||||
fprintf( FCGI_stderr,"ERRO: pthread_create() %s", strerror( (int)auxresponse->hTh));
|
fprintf( FCGI_stderr,"ERRO: pthread_create() %s", strerror( (int)auxresponse->hTh));
|
||||||
|
#else
|
||||||
|
status = pthread_create( &thread, NULL, &aux_streaming, auxresponse);
|
||||||
|
if( status != 0)
|
||||||
|
fprintf( FCGI_stderr,"ERROR: pthread_create() %s",strerror(status));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -166,10 +167,10 @@ bool identify_cid( SOCKET connected_socket, char refcid[], FILE *fp);
|
||||||
|
|
||||||
bool recv_ack( SOCKET connected_socket, void *data);
|
bool recv_ack( SOCKET connected_socket, void *data);
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef _WIN32
|
||||||
void * aux_streaming( void *arg)
|
|
||||||
#else
|
|
||||||
unsigned __stdcall aux_streaming( void *arg)
|
unsigned __stdcall aux_streaming( void *arg)
|
||||||
|
#else
|
||||||
|
void * aux_streaming( void *arg)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
SOCKET connected_socket;
|
SOCKET connected_socket;
|
||||||
|
@ -179,10 +180,10 @@ unsigned __stdcall aux_streaming( void *arg)
|
||||||
|
|
||||||
aux_response_param_t *auxresponse = (aux_response_param_t *)arg;
|
aux_response_param_t *auxresponse = (aux_response_param_t *)arg;
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef _WIN32
|
||||||
pthread_detach( pthread_self());
|
|
||||||
#else
|
|
||||||
CloseHandle( auxresponse->hTh);
|
CloseHandle( auxresponse->hTh);
|
||||||
|
#else
|
||||||
|
pthread_detach( pthread_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
chunk = (unsigned char *)malloc( auxresponse->maxlenPerFrame);
|
chunk = (unsigned char *)malloc( auxresponse->maxlenPerFrame);
|
||||||
|
@ -219,10 +220,10 @@ unsigned __stdcall aux_streaming( void *arg)
|
||||||
|
|
||||||
delete_auxresponse( &auxresponse);
|
delete_auxresponse( &auxresponse);
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef _WIN32
|
||||||
pthread_exit(0);
|
|
||||||
#else
|
|
||||||
_endthreadex(0);
|
_endthreadex(0);
|
||||||
|
#else
|
||||||
|
pthread_exit(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue