! : changed
+ : added
+August 25, 2011
++ [kaori] added tid request support to JPIP client
++ [kaori] added quit JPIP server request
+
August 24, 2011
+ [kaori] added cachemodel_manager, which had been managed in target_manager previously
-+ [kaori] added tid request support
++ [kaori] added tid request support to JPIP server
August 16, 2011
* [antonin] fixed cmake support for openjpip
2. Launch opj_server from the server terminal:
% spawn-fcgi -f ./opj_server -p 3000 -n
+
+ For shutting down JPIP server:
+ %GET http://hostname/myFCGI?quitJPIP
+ Notice, http://hostname/myFCGI is the HTTP server URI (myFCGI refers to opj_server by the server setting)
+ Requst message "quitJPIP" can be changed in Makfile, modify -DQUIT_SIGNAL=\"quitJPIP\"
Client:
1. Launch image decoding server, and keep it alive as long as image viewers are open
target->next=NULL;
- fprintf( FCGI_stdout, "JPIP-tid: %s\r\n", target->tid);
-
if( targetlist->first) // there are one or more entries
targetlist->last->next = target;
else // first entry
foundtarget = foundtarget->next;
}
- fprintf( FCGI_stdout, "Status: 404\r\n");
- fprintf( FCGI_stdout, "Reason: tid %s not found\r\n", tid);
-
return NULL;
}
free( *cachelist);
}
-cache_param_t * gene_cache( char *targetname, int csn, char *cid)
+cache_param_t * gene_cache( char *targetname, int csn, char *tid, char *cid)
{
cache_param_t *cache;
cache = (cache_param_t *)malloc( sizeof(cache_param_t));
strcpy( cache->filename, targetname);
+ strcpy( cache->tid, tid);
cache->csn = csn;
cache->cid = (char **)malloc( sizeof(char *));
*cache->cid = (char *)malloc( MAX_LENOFCID);
cache->numOfcid ++;
}
+void update_cachetid( char *tid, cache_param_t *cache)
+{
+ if( tid[0] != '0' && strcmp( tid, cache->tid) !=0){
+ fprintf( stderr, "tid is updated to %s for %s\n", tid, cache->filename);
+ strcpy( cache->tid, tid);
+ }
+}
+
void remove_cidInCache( char *cid, cache_param_t *cache);
void remove_cachecid( char *cid, cachelist_param_t *cachelist)
fprintf( stdout,"cache\n");
fprintf( stdout,"\t filename: %s\n", cache->filename);
+ fprintf( stdout,"\t tid: %s\n", cache->tid);
fprintf( stdout,"\t csn: %d\n", cache->csn);
fprintf( stdout,"\t cid:");
//! maximum length of target name
#define MAX_LENOFTARGET 128
+//! maximum length of target identifier
+#define MAX_LENOFTID 30
+
//! cache parameters
typedef struct cache_param{
char filename[MAX_LENOFTARGET]; //!< file name
+ char tid[MAX_LENOFTID]; //!< taregt identifier
int csn; //!< codestream number
char **cid; //!< dynamic array of channel identifiers
int numOfcid; //!< number of cids
*
* @param[in] targetname target file name
* @param[in] csn codestream number
+ * @param[in] tid target identifier
* @param[in] cid channel identifier
* @return pointer to the generated cache
*/
-cache_param_t * gene_cache( char *targetname, int csn, char *cid);
+cache_param_t * gene_cache( char *targetname, int csn, char *tid, char *cid);
/**
* delete a cache
*/
void add_cachecid( char *cid, cache_param_t *cache);
+
+/**
+ * update tid of a cache
+ *
+ * @param[in] tid target identifier
+ * @param[in] cache cache pointer
+ */
+void update_cachetid( char *tid, cache_param_t *cache);
+
+
/**
* remove cid in cache
*
{
int receive_size;
char buf[BUF_LEN];
- char *magicid[] = { "JPIP-stream", "PNM request", "XML request", "CID request", "CID destroy", "JP2 save", "QUIT"};
+ char *magicid[] = { "JPIP-stream", "PNM request", "XML request", "TID request", "CID request", "CID destroy", "JP2 save", "QUIT"};
int i;
receive_size = receive_line( connected_socket, buf);
for( i=0; i<NUM_OF_MSGTYPES; i++){
if( strncasecmp( magicid[i], buf, strlen(magicid[i])) == 0){
- printf("Client message: %s\n", magicid[i]);
+ printf("%s\n", magicid[i]);
return i;
}
}
return MSGERROR;
}
-Byte_t * receive_JPIPstream( SOCKET connected_socket, char *target, char *cid, int *streamlen)
+Byte_t * receive_JPIPstream( SOCKET connected_socket, char *target, char *tid, char *cid, int *streamlen)
{
Byte_t *jpipstream=NULL, *ptr;
- char buf[BUF_LEN], versionstring[] = "version 1.1";
+ char buf[BUF_LEN], versionstring[] = "version 1.2";
int linelen, redlen, remlen;
target[0] = 0;
if( strstr( buf, "jp2")){
// register cid option
strcpy( target, buf);
+
+ if((linelen = receive_line( connected_socket, buf)) == 0)
+ return NULL;
+ strcpy( tid, buf);
if((linelen = receive_line( connected_socket, buf)) == 0)
return NULL;
}
*streamlen = atoi( buf);
- fprintf( stderr, "Receiveing Data length: %d\n", *streamlen);
+ fprintf( stderr, "Receive Data: %d Bytes\n", *streamlen);
-
jpipstream = (unsigned char *)malloc( (*streamlen));
ptr = jpipstream;
remlen = (*streamlen);
remlen -= redlen;
ptr = ptr + redlen;
}
- fprintf( stderr, " done\n");
return jpipstream;
}
send_stream( connected_socket, xmlstream, length);
}
+void send_IDstream( SOCKET connected_socket, char *id, int idlen, char *label);
+
void send_CIDstream( SOCKET connected_socket, char *cid, int cidlen)
+{
+ send_IDstream( connected_socket, cid, cidlen, "CID");
+}
+
+void send_TIDstream( SOCKET connected_socket, char *tid, int tidlen)
+{
+ send_IDstream( connected_socket, tid, tidlen, "TID");
+}
+
+void send_IDstream( SOCKET connected_socket, char *id, int idlen, char *label)
{
Byte_t header[4];
- header[0] = 'C';
- header[1] = 'I';
- header[2] = 'D';
- header[3] = cidlen & 0xff;
+ header[0] = label[0];
+ header[1] = label[1];
+ header[2] = label[2];
+ header[3] = idlen & 0xff;
send_stream( connected_socket, header, 4);
- send_stream( connected_socket, cid, cidlen);
+ send_stream( connected_socket, id, idlen);
}
void send_PNMstream( SOCKET connected_socket, Byte_t *pnmstream, unsigned int width, unsigned int height, unsigned int numofcomp, Byte_t maxval)
*/
SOCKET open_listeningsocket();
-#define NUM_OF_MSGTYPES 7
-typedef enum eMSGTYPE{ JPIPSTREAM, PNMREQ, XMLREQ, CIDREQ, CIDDST, JP2SAVE, QUIT, MSGERROR} msgtype_t;
+#define NUM_OF_MSGTYPES 8
+typedef enum eMSGTYPE{ JPIPSTREAM, PNMREQ, XMLREQ, TIDREQ, CIDREQ, CIDDST, JP2SAVE, QUIT, MSGERROR} msgtype_t;
/**
* indeitify client message type
*
* @param [in] connected_socket file descriptor of the connected socket
* @param [out] target received target file name (if not received, null string)
+ * @param [out] tid received target identifier (if not received, null string)
* @param [out] cid received channel identifier (if not received, null string)
* @param [out] streamlen length of the received codestream
* @return JPT- JPP- codestream
*/
-Byte_t * receive_JPIPstream( SOCKET connected_socket, char *target, char *cid, int *streamlen);
+Byte_t * receive_JPIPstream( SOCKET connected_socket, char *target, char *tid, char *cid, int *streamlen);
/**
* send PGM/PPM image stream to the client
*/
void send_XMLstream( SOCKET connected_socket, Byte_t *xmlstream, int length);
+/**
+ * send TID data stream to the client
+ *
+ * @param [in] connected_socket file descriptor of the connected socket
+ * @param [in] tid tid string
+ * @param [in] tidlen legnth of the tid string
+ */
+void send_TIDstream( SOCKET connected_socket, char *tid, int tidlen);
+
/**
* send CID data stream to the client
*
*\section sec1 JPIP-stream
* Cache JPT- JPP- stream in server
*
- * client -> server: JPIP-stream\\n version 1.1\\n (optional for cid registration: targetnamestring\\n cidstring\\n) bytelengthvalue\\n data \n
+ * client -> server: JPIP-stream\\n version 1.1\\n (optional for cid registration: targetnamestring\\n tidstring\\n cidstring\\n) bytelengthvalue\\n data \n
* server -> client: 1 or 0 (of 1Byte response signal)
*
*\section sec2 PNM request
* client -> server: XML request\\n \n
* server -> client: XML (3Byte) length (2Byte Big endian) data
*
- *\section sec4 CID request
+ *\section sec4 TID request
+ * Get target ID of target image
+ *
+ * client -> server: TID request\\n targetname\\n \n
+ * server -> client: TID (3Byte) length (1Byte) tiddata
+ *
+ *\section sec5 CID request
* Get Channel ID of identical target image
*
* client -> server: CID request\\n targetname\\n \n
* server -> client: CID (3Byte) length (1Byte) ciddata
*
- *\section sec5 CID destroy
+ *\section sec6 CID destroy
* Close Channel ID
*
* client -> server: CID destroy\\n ciddata \n
* server -> client: 1 or 0 (of 1Byte response signal)
*
- *\section sec6 JP2 save
+ *\section sec7 JP2 save
* Save in JP2 file format
*
* client -> server: JP2 save\\n ciddata \n
* server -> client: 1 or 0 (of 1Byte response signal)
*
- *\section sec7 QUIT
+ *\section sec8 QUIT
* Quit the opj_dec_server program
*
* client -> server: quit or QUIT
*/
void handle_XMLreqMSG( SOCKET connected_socket, Byte_t *jpipstream, cachelist_param_t *cachelist);
+/**
+ * handle TargetID request message
+ *
+ * @param[in] connected_socket socket descriptor
+ * @param[in] cachelist cache list pointer
+ */
+void handle_TIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
+
/**
* handle ChannelID request message
*
case XMLREQ:
handle_XMLreqMSG( connected_socket, jpipstream, cachelist);
break;
+
+ case TIDREQ:
+ handle_TIDreqMSG( connected_socket, cachelist);
+ break;
case CIDREQ:
handle_CIDreqMSG( connected_socket, cachelist);
break;
}
- printf("cut the connection. listening to port\n");
+ printf("\t end of the connection\n\n");
if( closesocket(connected_socket) != 0){
perror("close");
return -1;
Byte_t *newjpipstream;
int newstreamlen = 0;
cache_param_t *cache;
- char target[MAX_LENOFTARGET], cid[MAX_LENOFCID];
+ char target[MAX_LENOFTARGET], tid[MAX_LENOFTID], cid[MAX_LENOFCID];
metadatalist_param_t *metadatalist;
- newjpipstream = receive_JPIPstream( connected_socket, target, cid, &newstreamlen);
+ newjpipstream = receive_JPIPstream( connected_socket, target, tid, cid, &newstreamlen);
parse_JPIPstream( newjpipstream, newstreamlen, *streamlen, msgqueue);
parse_metamsg( msgqueue, *jpipstream, *streamlen, metadatalist);
// cid registration
- if( target[0] != 0 && cid[0] != 0){
- if((cache = search_cache( target, cachelist)))
+ if( target[0] != 0 && tid[0] != 0 && cid[0] != 0){
+ if((cache = search_cache( target, cachelist))){
add_cachecid( cid, cache);
+ update_cachetid( tid, cache);
+ }
else{
- cache = gene_cache( target, msgqueue->last->csn, cid);
+ cache = gene_cache( target, msgqueue->last->csn, tid, cid);
insert_cache_into_list( cache, cachelist);
}
}
free( xmlstream);
}
+void handle_TIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist)
+{
+ char target[MAX_LENOFTARGET], *tid = NULL;
+ cache_param_t *cache;
+ int tidlen = 0;
+
+ receive_line( connected_socket, target);
+ cache = search_cache( target, cachelist);
+
+ if( cache){
+ tid = cache->tid;
+ tidlen = strlen(tid);
+ }
+ send_TIDstream( connected_socket, tid, tidlen);
+}
+
void handle_CIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist)
{
char target[MAX_LENOFTARGET], *cid = NULL;
-opj_viewer-20110824.jar
\ No newline at end of file
+opj_viewer-20110825.jar
\ No newline at end of file
String refcid = ImgdecClient.query_cid( j2kfilename);
byte[] jpipstream;
- if( refcid == null)
- jpipstream = super.requestViewWindow( j2kfilename, reqfw, reqfh, true);
+ if( refcid == null){
+ String reftid = ImgdecClient.query_tid( j2kfilename);
+ if( reftid == null)
+ jpipstream = super.requestViewWindow( j2kfilename, reqfw, reqfh, true);
+ else
+ jpipstream = super.requestViewWindow( j2kfilename, reftid, reqfw, reqfh, true);
+ }
else
jpipstream = super.requestViewWindow( reqfw, reqfh, refcid, true);
System.err.println( "decoding to PNM image");
- pnmimage = ImgdecClient.decode_jpipstream( jpipstream, j2kfilename, cid, fw, fh);
+ pnmimage = ImgdecClient.decode_jpipstream( jpipstream, j2kfilename, tid, cid, fw, fh);
System.err.println( " done");
-
- // System.out.println( "fw: " + fw + " fh: " + fh + "pnm w: ");
return pnmimage.createROIImage( rx, ry, rw, rh);
}
return get_PNMstream( cid, fw, fh);
}
- public static PnmImage decode_jpipstream( byte[] jpipstream, String j2kfilename, String cid, int fw, int fh)
+ public static PnmImage decode_jpipstream( byte[] jpipstream, String j2kfilename, String tid, String cid, int fw, int fh)
{
- send_JPIPstream( jpipstream, j2kfilename, cid);
+ send_JPIPstream( jpipstream, j2kfilename, tid, cid);
return get_PNMstream( cid, fw, fh);
}
System.err.println("Sending " + jpipstream.length + "Data Bytes to decodingServer");
os.writeBytes("JPIP-stream\n");
- os.writeBytes("version 1.1\n");
+ os.writeBytes("version 1.2\n");
os.writeBytes( jpipstream.length + "\n");
os.write( jpipstream, 0, jpipstream.length);
}
}
- public static void send_JPIPstream( byte[] jpipstream, String j2kfilename, String cid)
+ public static void send_JPIPstream( byte[] jpipstream, String j2kfilename, String tid, String cid)
{
try{
Socket imgdecSocket = new Socket( "localhost", 5000);
System.err.println("Sending " + length + "Data Bytes to decodingServer");
os.writeBytes("JPIP-stream\n");
- os.writeBytes("version 1.1\n");
+ os.writeBytes("version 1.2\n");
os.writeBytes( j2kfilename + "\n");
+ if( tid == null)
+ os.writeBytes( "0\n");
+ else
+ os.writeBytes( tid + "\n");
os.writeBytes( cid + "\n");
os.writeBytes( length + "\n");
os.write( jpipstream, 0, length);
public static String query_cid( String j2kfilename)
{
- String cid = null;
+ int []retmsglabel = new int[3];
+ retmsglabel[0] = 67;
+ retmsglabel[1] = 73;
+ retmsglabel[2] = 68;
+
+ return query_id( "CID request", j2kfilename, retmsglabel);
+ }
+
+ public static String query_tid( String j2kfilename)
+ {
+ int []retmsglabel = new int[3];
+ retmsglabel[0] = 84;
+ retmsglabel[1] = 73;
+ retmsglabel[2] = 68;
+
+ return query_id( "TID request", j2kfilename, retmsglabel);
+ }
+
+ public static String query_id( String reqmsghead, String j2kfilename, int[] retmsglabel)
+ {
+ String id = null;
try{
Socket imgdecSocket = new Socket( "localhost", 5000);
DataInputStream is = new DataInputStream( imgdecSocket.getInputStream());
byte []header = new byte[4];
- os.writeBytes("CID request\n");
+ os.writeBytes( reqmsghead + "\n");
os.writeBytes( j2kfilename + "\n");
read_stream( is, header, 4);
- if( header[0] == 67 && header[1] == 73 && header[2] == 68){
+ if( header[0] == retmsglabel[0] && header[1] == retmsglabel[1] && header[2] == retmsglabel[2]){
int length = header[3]&0xff;
if( length > 0){
- byte []ciddata = new byte[ length];
- read_stream( is, ciddata, length);
- cid = new String( ciddata);
+ byte []iddata = new byte[ length];
+ read_stream( is, iddata, length);
+ id = new String( iddata);
}
}
else
- System.err.println("Error in query_cid(), not starting with CID");
+ System.err.println("Error in query_id("+ reqmsghead + "), wrong to start with " + header);
}
catch (UnknownHostException e) {
System.err.println("Trying to connect to unknown host: " + e);
System.err.println("IOException: " + e);
}
- return cid;
+ return id;
}
public static void read_stream( DataInputStream is, byte []stream, int length)
public byte[] requestViewWindow( int reqfw, int reqfh, String reqcid)
{
- return requestViewWindow( null, reqfw, reqfh, -1, -1, -1, -1, reqcid, false);
+ return requestViewWindow( null, null, reqfw, reqfh, -1, -1, -1, -1, reqcid, false);
}
public byte[] requestViewWindow( int reqfw, int reqfh, int reqrx, int reqry, int reqrw, int reqrh, String reqcid)
{
- return requestViewWindow( null, reqfw, reqfh, reqrx, reqry, reqrw, reqrh, reqcid, false);
+ return requestViewWindow( null, null, reqfw, reqfh, reqrx, reqry, reqrw, reqrh, reqcid, false);
}
public byte[] requestViewWindow( String target, int reqfw, int reqfh)
{
- return requestViewWindow( target, reqfw, reqfh, -1, -1, -1, -1, null, false);
+ return requestViewWindow( target, null, reqfw, reqfh, -1, -1, -1, -1, null, false);
}
public byte[] requestViewWindow( String target, int reqfw, int reqfh, boolean reqcnew)
{
if( cid == null) // 1 channel allocation only
- return requestViewWindow( target, reqfw, reqfh, -1, -1, -1, -1, null, reqcnew);
+ return requestViewWindow( target, null, reqfw, reqfh, -1, -1, -1, -1, null, reqcnew);
+ else
+ return null;
+ }
+
+ public byte[] requestViewWindow( String target, String reqtid, int reqfw, int reqfh, boolean reqcnew)
+ {
+ if( cid == null) // 1 channel allocation only
+ return requestViewWindow( target, reqtid, reqfw, reqfh, -1, -1, -1, -1, null, reqcnew);
else
return null;
}
public byte[] requestViewWindow( String target, int reqfw, int reqfh, int reqrx, int reqry, int reqrw, int reqrh)
{
- return requestViewWindow( target, reqfw, reqfh, reqrx, reqry, reqrw, reqrh, null, false);
+ return requestViewWindow( target, null, reqfw, reqfh, reqrx, reqry, reqrw, reqrh, null, false);
}
public byte[] requestViewWindow( int reqfw, int reqfh, String reqcid, boolean reqcnew)
{
- return requestViewWindow( null, reqfw, reqfh, -1, -1, -1, -1, reqcid, reqcnew);
+ return requestViewWindow( null, null, reqfw, reqfh, -1, -1, -1, -1, reqcid, reqcnew);
}
- public byte[] requestViewWindow( String target,
- int reqfw, int reqfh,
- int reqrx, int reqry,
- int reqrw, int reqrh,
- String reqcid, boolean reqcnew)
+ public byte[] requestViewWindow( String target,
+ String reqtid,
+ int reqfw, int reqfh,
+ int reqrx, int reqry,
+ int reqrw, int reqrh,
+ String reqcid, boolean reqcnew)
{
- String urlstring = const_urlstring( target, reqfw, reqfh, reqrx, reqry, reqrw, reqrh, reqcid, reqcnew);
+ if( reqtid != null)
+ tid = reqtid;
+
+ String urlstring = const_urlstring( target, reqtid, reqfw, reqfh, reqrx, reqry, reqrw, reqrh, reqcid, reqcnew);
return GETrequest( urlstring);
}
Map<String,java.util.List<String>> headers = urlconn.getHeaderFields();
java.util.List<String> hvaluelist;
-
+
+ String status = headers.get(null).get(0);
+
+ System.err.println( status);
+ if( !status.contains("OK"))
+ System.err.println( headers.get("Reason"));
+ System.err.println( headers.get("Content-type"));
+
if(( hvaluelist = headers.get("JPIP-fsiz")) != null){
String hvalueline = hvaluelist.get(0);
fw = Integer.valueOf( hvalueline.substring( 0, hvalueline.indexOf(','))).intValue();
return jpipstream;
}
- private String const_urlstring( String target,
+ private String const_urlstring( String target,
+ String reqtid,
int reqfw, int reqfh,
int reqrx, int reqry,
int reqrw, int reqrh,
urlstring = urlstring.concat( "&");
urlstring = urlstring.concat( "target=" + target);
}
+ if( reqtid != null){
+ if( !urlstring.endsWith("?"))
+ urlstring = urlstring.concat( "&");
+ urlstring = urlstring.concat( "tid=" + reqtid);
+ }
if( reqfw != -1 && reqfh != -1){
if( !urlstring.endsWith("?"))
urlstring = urlstring.concat( "&");
-opj_viewer_xerces-20110824.jar
\ No newline at end of file
+opj_viewer_xerces-20110825.jar
\ No newline at end of file
-I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip \
@FCGI_CFLAGS@ \
--DSERVER
+-DSERVER \
+-DQUIT_SIGNAL=\"quitJPIP\"
opj_server_CFLAGS =
opj_server_LDADD = $(top_builddir)/applications/jpip/libopenjpip/libopenjpip_server.la @FCGI_LIBS@ -lm
opj_server_SOURCES = \
LIBDIR = ../libopenjpip
LIBFNAME = $(LIBDIR)/libopenjpip_server.a
-CFLAGS = -O3 -Wall -m32 -DSERVER -I$(LIBDIR)
+CFLAGS = -O3 -Wall -m32 -DSERVER -DQUIT_SIGNAL=\"quitJPIP\" -I$(LIBDIR)
LDFLAGS = -L$(LIBDIR) -lm -lfcgi -lopenjpip_server
ALL = opj_server
#include "imgreg_manager.h"
#include "msgqueue_manager.h"
+#ifndef QUIT_SIGNAL
+#define QUIT_SIGNAL "quitJPIP"
+#endif
#ifdef SERVER
#include "fcgi_stdio.h"
#ifdef SERVER
query_string = getenv("QUERY_STRING");
#endif //SERVER
+
+ if( strcmp( query_string, QUIT_SIGNAL) == 0)
+ break;
fprintf( FCGI_stdout, "Content-type: image/jpt-stream\r\n");
delete_msgqueue( &msgqueue);
}
+
+ fprintf( FCGI_stderr, "JPIP server terminated by a client request\n");
delete_sessionlist( &sessionlist);
delete_targetlist( &targetlist);
session_param_t *cursession = NULL;
channel_param_t *curchannel = NULL;
- if( !identify_target( query_param, targetlist, &target))
- return false;
-
+ if( query_param.target[0] != '\0' || query_param.tid[0] != '\0'){
+ if( !identify_target( query_param, targetlist, &target))
+ return false;
+ }
+
if( query_param.cid[0] != '\0'){
if( !associate_channel( query_param, sessionlist, &cursession, &curchannel))
return false;
bool identify_target( query_param_t query_param, targetlist_param_t *targetlist, target_param_t **target)
{
+ if( query_param.tid[0] !='\0' && strcmp( query_param.tid, "0") != 0 ){
+ if( query_param.cid[0] != '\0'){
+ fprintf( FCGI_stdout, "Reason: Target can not be specified both through tid and cid\r\n");
+ fprintf( FCGI_stdout, "Status: 400\r\n");
+ return false;
+ }
+ if( ( *target = search_targetBytid( query_param.tid, targetlist)))
+ return true;
+ }
+
if( query_param.target[0] !='\0')
if( !( *target = search_target( query_param.target, targetlist)))
if(!( *target = gene_target( targetlist, query_param.target)))
return false;
- if( query_param.tid[0] !='\0'){
- if( strcmp( query_param.tid, "0") != 0 ){
- if( query_param.cid[0] != '\0'){
- fprintf( FCGI_stdout, "Reason: Target can not be specified both through tid and cid\r\n");
- fprintf( FCGI_stdout, "Status: 400\r\n");
- return false;
- }
- if( !( *target = search_targetBytid( query_param.tid, targetlist)))
- return false;
- }
- else{
- if( *target)
- fprintf( FCGI_stdout, "JPIP-tid: %s\r\n", (*target)->tid);
- else{
- fprintf( FCGI_stdout, "Reason: target not specified\r\n");
- fprintf( FCGI_stdout, "Status: 400\r\n");
- return false;
- }
- }
+ if( *target){
+ fprintf( FCGI_stdout, "JPIP-tid: %s\r\n", (*target)->tid);
+ return true;
+ }
+ else{
+ fprintf( FCGI_stdout, "Reason: target not found\r\n");
+ fprintf( FCGI_stdout, "Status: 400\r\n");
+ return false;
}
- return true;
}
bool associate_channel( query_param_t query_param,