... | ... |
@@ -26,6 +26,7 @@ |
26 | 26 |
* |
27 | 27 |
* History: |
28 | 28 |
* --------- |
29 |
+ * 2003-02-28 scratchpad compatibility abandoned (jiri) |
|
29 | 30 |
* 2003-01-29 removed scratchpad (jiri) |
30 | 31 |
*/ |
31 | 32 |
|
... | ... |
@@ -184,11 +185,7 @@ int do_action(struct action* a, struct sip_msg* msg) |
184 | 185 |
/*udp*/ |
185 | 186 |
send_sock=get_send_socket(to, PROTO_UDP); |
186 | 187 |
if (send_sock!=0){ |
187 |
-#ifdef SCRATCH |
|
188 |
- ret=udp_send(send_sock, msg->orig, msg->len, to); |
|
189 |
-#else |
|
190 | 188 |
ret=udp_send(send_sock, msg->buf, msg->len, to); |
191 |
-#endif |
|
192 | 189 |
}else{ |
193 | 190 |
ret=-1; |
194 | 191 |
} |
... | ... |
@@ -196,11 +193,7 @@ int do_action(struct action* a, struct sip_msg* msg) |
196 | 193 |
#ifdef USE_TCP |
197 | 194 |
else{ |
198 | 195 |
/*tcp*/ |
199 |
-#ifdef SCRATCH |
|
200 |
- ret=tcp_send(msg->orig, msg->len, to, 0); |
|
201 |
-#else |
|
202 | 196 |
ret=tcp_send(msg->buf, msg->len, to, 0); |
203 |
-#endif |
|
204 | 197 |
} |
205 | 198 |
#endif |
206 | 199 |
} |
... | ... |
@@ -37,35 +37,5 @@ |
37 | 37 |
#ifndef _COMP_DEFS_H |
38 | 38 |
#define _COMP_DEFS_H |
39 | 39 |
|
40 |
-/* preserve "old" parser which delimited header fields by zeros, |
|
41 |
- * and included deliminitors in body (which was the only way to |
|
42 |
- * learn length of the whole header field |
|
43 |
- */ |
|
44 |
-#undef PRESERVE_ZT |
|
45 |
- |
|
46 |
-/* go one step further and remove ZT from first line too */ |
|
47 |
-#undef DONT_REMOVE_ZT |
|
48 |
- |
|
49 |
-/* make it all -- move ZT away (Via) */ |
|
50 |
-#define REMOVE_ALL_ZT |
|
51 |
- |
|
52 |
-/* don't use scratchpad anymore */ |
|
53 |
-#undef SCRATCH |
|
54 |
- |
|
55 |
- |
|
56 |
-/* ------------------------------------------------------ */ |
|
57 |
-/* don't touch this -- that's helper macros depending on |
|
58 |
- * the backwards compatibility macros above */ |
|
59 |
-#ifdef PRESERVE_ZT |
|
60 |
-# define SET_ZT(_ch) (_ch)='\0' |
|
61 |
-#else |
|
62 |
-# define SET_ZT(_ch) |
|
63 |
-#endif |
|
64 |
- |
|
65 |
-#ifdef REMOVE_ALL_ZT |
|
66 |
-# define VIA_ZT(_ch) |
|
67 |
-#else |
|
68 |
-# define VIA_ZT(ch) (_ch)='\0' |
|
69 |
-#endif |
|
70 | 40 |
|
71 | 41 |
#endif |
... | ... |
@@ -185,18 +185,6 @@ static void consume_request( FILE *stream ) |
185 | 185 |
|
186 | 186 |
while(!read_line(buffer, MAX_CONSUME_BUFFER, stream, &len)); |
187 | 187 |
|
188 |
-#ifdef _OBSOLETED |
|
189 |
- int eol_count; |
|
190 |
- |
|
191 |
- eol_count=0; |
|
192 |
- |
|
193 |
- /* each request must be terminated by two EoLs */ |
|
194 |
- while(eol_count!=2) { |
|
195 |
- /* read until EoL is encountered */ |
|
196 |
- while(!read_line(buffer, MAX_CONSUME_BUFFER, stream, &len)); |
|
197 |
- eol_count=len==0?eol_count+1:1; |
|
198 |
- } |
|
199 |
-#endif |
|
200 | 188 |
} |
201 | 189 |
|
202 | 190 |
int read_eol( FILE *stream ) |
... | ... |
@@ -112,56 +112,6 @@ void* _shm_resize( void* p , unsigned int s) |
112 | 112 |
return sh_realloc( p, s ); |
113 | 113 |
} |
114 | 114 |
|
115 |
-#ifdef _OBSOLETED |
|
116 |
-#ifdef DBG_QM_MALLOC |
|
117 |
-void* _shm_resize( void* p, unsigned int s, char* file, char* func, |
|
118 |
- unsigned int line) |
|
119 |
-#else |
|
120 |
-void* _shm_resize( void* p , unsigned int s) |
|
121 |
-#endif |
|
122 |
-{ |
|
123 |
- |
|
124 |
-#ifdef VQ_MALLOC |
|
125 |
- struct vqm_frag *f; |
|
126 |
-#else |
|
127 |
- #ifdef __SUNPRO_C |
|
128 |
- /*no warning support on Sun cc */ |
|
129 |
- #else |
|
130 |
- #ifdef _NO_NO_NO |
|
131 |
- #warning shm_resize performs suboptimally without VQ_MALLOC! |
|
132 |
- #endif |
|
133 |
- #endif |
|
134 |
-#endif |
|
135 |
- |
|
136 |
- if (p==0) { |
|
137 |
- DBG("WARNING:vqm_resize: resize(0) called\n"); |
|
138 |
- return shm_malloc( s ); |
|
139 |
- } |
|
140 |
- |
|
141 |
-# ifdef VQ_MALLOC |
|
142 |
- f=(struct vqm_frag*) ((char*)p-sizeof(struct vqm_frag)); |
|
143 |
-# ifdef DBG_QM_MALLOC |
|
144 |
- DBG("_shm_resize(%p, %d), called from %s: %s(%d)\n", |
|
145 |
- p, s, file, func, line); |
|
146 |
- VQM_DEBUG_FRAG(shm_block, f); |
|
147 |
- if (p>(void *)shm_block->core_end || p<(void*)shm_block->init_core){ |
|
148 |
- LOG(L_CRIT, "BUG: vqm_free: bad pointer %p (out of memory block!) - " |
|
149 |
- "aborting\n", p); |
|
150 |
- abort(); |
|
151 |
- } |
|
152 |
-# endif |
|
153 |
- if (s <= f->size-VQM_OVERHEAD) { |
|
154 |
-# ifdef DBG_QM_MALLOC |
|
155 |
- DBG("DEBUG: happy guy -- you reused a memory fragment!\n"); |
|
156 |
-# endif |
|
157 |
- return p; |
|
158 |
- }; |
|
159 |
-#endif |
|
160 |
- /* we can't make the request happy with current size */ |
|
161 |
- return sh_realloc( p, s ); |
|
162 |
-} |
|
163 |
-#endif |
|
164 |
- |
|
165 | 115 |
|
166 | 116 |
|
167 | 117 |
int shm_mem_init() |
... | ... |
@@ -32,13 +32,6 @@ |
32 | 32 |
|
33 | 33 |
#include "defs.h" |
34 | 34 |
|
35 |
-#ifdef _OBSOLETED |
|
36 |
-/* moved to hash.h */ |
|
37 |
-/* always use a power of 2 for hash table size */ |
|
38 |
-#define T_TABLE_POWER 12 |
|
39 |
-#define TABLE_ENTRIES (1 << (T_TABLE_POWER)) |
|
40 |
-#endif |
|
41 |
- |
|
42 | 35 |
/* this is where table size is defined now -- sort of |
43 | 36 |
ugly, core should not be bothered by TM table size, |
44 | 37 |
but on the other, core's stateless forwarding should |
... | ... |
@@ -107,12 +107,6 @@ void free_cell( struct cell* dead_cell ) |
107 | 107 |
/* retransmission buffer */ |
108 | 108 |
if ( (b=dead_cell->uac[i].request.buffer) ) |
109 | 109 |
shm_free_unsafe( b ); |
110 |
-#ifdef OLD_CANCEL |
|
111 |
- if ( (b=dead_cell->uac[i].request.ack) ) |
|
112 |
- shm_free_unsafe( b ); |
|
113 |
- if ( (b=dead_cell->uac[i].request.cancel) ) |
|
114 |
- shm_free_unsafe( b ); |
|
115 |
-#endif |
|
116 | 110 |
b=dead_cell->uac[i].local_cancel.buffer; |
117 | 111 |
if (b!=0 && b!=BUSY_BUFFER) |
118 | 112 |
shm_free_unsafe( b ); |
... | ... |
@@ -120,10 +114,6 @@ void free_cell( struct cell* dead_cell ) |
120 | 114 |
if (rpl && rpl!=FAKED_REPLY) { |
121 | 115 |
sip_msg_free_unsafe( rpl ); |
122 | 116 |
} |
123 |
-#ifdef _OBSOLETED |
|
124 |
- if ( (b=dead_cell->uac[i].rpl_buffer.s) ) |
|
125 |
- shm_free_unsafe( b ); |
|
126 |
-#endif |
|
127 | 117 |
} |
128 | 118 |
|
129 | 119 |
/* the cell's body */ |
... | ... |
@@ -296,10 +286,6 @@ struct s_table* init_hash_table() |
296 | 286 |
|
297 | 287 |
return tm_table; |
298 | 288 |
|
299 |
-#ifdef _OBSO |
|
300 |
-error2: |
|
301 |
- lock_cleanup(); |
|
302 |
-#endif |
|
303 | 289 |
error1: |
304 | 290 |
free_hash_table( ); |
305 | 291 |
error0: |
... | ... |
@@ -249,10 +249,6 @@ struct s_table |
249 | 249 |
{ |
250 | 250 |
/* table of hash entries; each of them is a list of synonyms */ |
251 | 251 |
struct entry entrys[ TABLE_ENTRIES ]; |
252 |
-#ifdef _OBSOLETED |
|
253 |
- /* table of timer lists */ |
|
254 |
- struct timer timers[ NR_OF_TIMER_LISTS ]; |
|
255 |
-#endif |
|
256 | 252 |
}; |
257 | 253 |
|
258 | 254 |
|
... | ... |
@@ -76,12 +76,6 @@ static int |
76 | 76 |
entry_semaphore=0, |
77 | 77 |
timer_semaphore=0, |
78 | 78 |
reply_semaphore=0; |
79 |
-#ifdef _OBSOLETED |
|
80 |
- ack_semaphore=0; |
|
81 |
-#endif |
|
82 |
-#ifdef _XWAIT |
|
83 |
-static int wait_semaphore=0; |
|
84 |
-#endif |
|
85 | 79 |
/* and the maximum number of semaphores in the entry_semaphore set */ |
86 | 80 |
static int sem_nr; |
87 | 81 |
/* timer group locks */ |
... | ... |
@@ -199,14 +193,6 @@ again: |
199 | 193 |
semctl( entry_semaphore, 0 , IPC_RMID , 0 ); |
200 | 194 |
if (reply_semaphore>0) |
201 | 195 |
semctl(reply_semaphore, 0 , IPC_RMID , 0 ); |
202 |
-#ifdef _OBSOLETED |
|
203 |
- if (ack_semaphore>0) |
|
204 |
- semctl(reply_semaphore, 0 , IPC_RMID , 0 ); |
|
205 |
-#endif |
|
206 |
-#ifdef _XWAIT |
|
207 |
- if (wait_semaphore>0) |
|
208 |
- semctl(wait_semaphore, 0 , IPC_RMID , 0 ); |
|
209 |
-#endif |
|
210 | 196 |
|
211 | 197 |
|
212 | 198 |
if (i==0){ |
... | ... |
@@ -263,40 +249,6 @@ again: |
263 | 249 |
goto error; |
264 | 250 |
} |
265 | 251 |
} |
266 |
-#ifdef _OBSOLETED |
|
267 |
- if ((ack_semaphore=init_semaphore_set(sem_nr))<0){ |
|
268 |
- if (errno==EINVAL || errno==ENOSPC ) { |
|
269 |
- DBG( "DEBUG:lock_initialize: ack semaphore initialization" |
|
270 |
- " failure: %s\n", strerror(errno)); |
|
271 |
- probe_run==1; |
|
272 |
- i--; |
|
273 |
- goto again; |
|
274 |
- }else{ |
|
275 |
- LOG(L_CRIT, "ERROR:lock_initialize: ack semaphore initialization" |
|
276 |
- " failure: %s\n", strerror(errno)); |
|
277 |
- goto error; |
|
278 |
- } |
|
279 |
- } |
|
280 |
-#endif |
|
281 |
- |
|
282 |
-#ifdef _XWAIT |
|
283 |
- if ((wait_semaphore=init_semaphore_set(sem_nr))<0){ |
|
284 |
- if (errno==EINVAL || errno==ENOSPC ) { |
|
285 |
- DBG( "DEBUG:lock_initialize: wait semaphore initialization" |
|
286 |
- " failure: %s\n", strerror(errno)); |
|
287 |
- probe_run==1; |
|
288 |
- i--; |
|
289 |
- goto again; |
|
290 |
- }else{ |
|
291 |
- LOG(L_CRIT, "ERROR:lock_initialize: wait semaphore initialization" |
|
292 |
- " failure: %s\n", strerror(errno)); |
|
293 |
- goto error; |
|
294 |
- } |
|
295 |
- } |
|
296 |
-#endif |
|
297 |
- |
|
298 |
- |
|
299 |
- |
|
300 | 252 |
|
301 | 253 |
/* return success */ |
302 | 254 |
LOG(L_INFO, "INFO: semaphore arrays of size %d allocated\n", sem_nr ); |
... | ... |
@@ -336,26 +288,8 @@ void lock_cleanup() |
336 | 288 |
if (reply_semaphore > 0 && |
337 | 289 |
semctl( reply_semaphore, 0 , IPC_RMID , 0 )==-1) |
338 | 290 |
LOG(L_ERR, "ERROR: lock_cleanup, reply_semaphore cleanup failed\n"); |
339 |
-#ifdef _OBSOLETED |
|
340 |
- if (ack_semaphore > 0 && |
|
341 |
- semctl( ack_semaphore, 0 , IPC_RMID , 0 )==-1) |
|
342 |
- LOG(L_ERR, "ERROR: lock_cleanup, ack_semaphore cleanup failed\n"); |
|
343 |
-#endif |
|
344 |
-#ifdef _XWAIT |
|
345 |
- if (wait_semaphore > 0 && |
|
346 |
- semctl( wait_semaphore, 0 , IPC_RMID , 0 )==-1) |
|
347 |
- LOG(L_ERR, "ERROR: lock_cleanup, wait_semaphore cleanup failed\n"); |
|
348 |
-#endif |
|
349 | 291 |
|
350 |
- |
|
351 |
- entry_semaphore = timer_semaphore = reply_semaphore |
|
352 |
-#ifdef _OBSOLETED |
|
353 |
- = ack_semaphore |
|
354 |
-#endif |
|
355 |
- = 0; |
|
356 |
-#ifdef _XWAIT |
|
357 |
- wait_semaphore = 0; |
|
358 |
-#endif |
|
292 |
+ entry_semaphore = timer_semaphore = reply_semaphore = 0; |
|
359 | 293 |
|
360 | 294 |
if (timer_group_lock) shm_free(timer_group_lock); |
361 | 295 |
|
... | ... |
@@ -370,24 +304,10 @@ int init_cell_lock( struct cell *cell ) |
370 | 304 |
{ |
371 | 305 |
#ifdef FAST_LOCK |
372 | 306 |
init_lock(cell->reply_mutex); |
373 |
-#ifdef _OBSOLETED |
|
374 |
- init_lock(cell->ack_mutex); |
|
375 |
-#endif |
|
376 |
-#ifdef _XWAIT |
|
377 |
- init_lock(cell->wait_mutex); |
|
378 |
-#endif |
|
379 | 307 |
return 0; |
380 | 308 |
#else |
381 | 309 |
cell->reply_mutex.semaphore_set=reply_semaphore; |
382 | 310 |
cell->reply_mutex.semaphore_index = cell->hash_index % sem_nr; |
383 |
-#ifdef _OBSOLETED |
|
384 |
- cell->ack_mutex.semaphore_set=ack_semaphore; |
|
385 |
- cell->ack_mutex.semaphore_index = cell->hash_index % sem_nr; |
|
386 |
-#endif |
|
387 |
-#ifdef _XWAIT |
|
388 |
- cell->wait_mutex.semaphore_set=wait_semaphore; |
|
389 |
- cell->wait_mutex.semaphore_index = cell->hash_index % sem_nr; |
|
390 |
-#endif /* WAIT */ |
|
391 | 311 |
#endif /* FAST_LOCK */ |
392 | 312 |
return 0; |
393 | 313 |
} |
... | ... |
@@ -37,6 +37,7 @@ |
37 | 37 |
* |
38 | 38 |
* History: |
39 | 39 |
* -------- |
40 |
+ * 2003-02-28 scratchpad compatibility abandoned (jiri) |
|
40 | 41 |
* 2003-02-25 - auth_body cloner added (janakj) |
41 | 42 |
* 2003-01-29 - scratchpad removed (jiri) |
42 | 43 |
* 2003-01-23 - msg_cloner clones msg->from->parsed too (janakj) |
... | ... |
@@ -344,17 +345,10 @@ struct sip_msg* sip_msg_cloner( struct sip_msg *org_msg ) |
344 | 345 |
p += ROUND4(org_msg->new_uri.len); |
345 | 346 |
} |
346 | 347 |
/* message buffers(org and scratch pad) */ |
347 |
-#ifdef SCRATCH |
|
348 |
- memcpy( p , org_msg->orig , org_msg->len); |
|
349 |
- /* ZT to be safer */ |
|
350 |
- *(p+org_msg->len)=0; |
|
351 |
- new_msg->orig = new_msg->buf = p; |
|
352 |
-#else |
|
353 | 348 |
memcpy( p , org_msg->buf, org_msg->len); |
354 | 349 |
/* ZT to be safer */ |
355 | 350 |
*(p+org_msg->len)=0; |
356 | 351 |
new_msg->buf = p; |
357 |
-#endif |
|
358 | 352 |
p += ROUND4(new_msg->len+1); |
359 | 353 |
/* unparsed and eoh pointer */ |
360 | 354 |
new_msg->unparsed = translate_pointer(new_msg->buf ,org_msg->buf, |
... | ... |
@@ -96,11 +96,6 @@ void cancel_branch( struct cell *t, int branch ) |
96 | 96 |
crb->buffer_len=len; |
97 | 97 |
crb->dst=irb->dst; |
98 | 98 |
crb->branch=branch; |
99 |
-#ifdef _OBSOLETED |
|
100 |
- crb->fr_timer.tg=TG_FR; |
|
101 |
- crb->retr_timer.tg=TG_RT; |
|
102 |
- crb->my_T=t; |
|
103 |
-#endif |
|
104 | 99 |
crb->retr_timer.payload=crb->fr_timer.payload=crb; |
105 | 100 |
/* label it as cancel so that FR timer can better now how to |
106 | 101 |
deal with it */ |
... | ... |
@@ -55,17 +55,6 @@ |
55 | 55 |
#include "config.h" |
56 | 56 |
|
57 | 57 |
|
58 |
-#ifdef _OBSOLETED |
|
59 |
-#define shm_free_lump( _lmp) \ |
|
60 |
- do{\ |
|
61 |
- if ((_lmp)) {\ |
|
62 |
- if ((_lmp)->op==LUMP_ADD && (_lmp)->u.value )\ |
|
63 |
- shm_free((_lmp)->u.value);\ |
|
64 |
- shm_free((_lmp));\ |
|
65 |
- }\ |
|
66 |
- }while(0); |
|
67 |
-#endif |
|
68 |
- |
|
69 | 58 |
char *print_uac_request( struct cell *t, struct sip_msg *i_req, |
70 | 59 |
int branch, str *uri, unsigned int *len, struct socket_info *send_sock ) |
71 | 60 |
{ |
... | ... |
@@ -104,18 +93,6 @@ char *print_uac_request( struct cell *t, struct sip_msg *i_req, |
104 | 93 |
other branches and for shmem i_req they would mix up |
105 | 94 |
shmem with pkg_mem |
106 | 95 |
*/ |
107 |
-#ifdef OBSOLETED |
|
108 |
- if (branch) for(b=i_req->add_rm,b1=0;b;b1=b,b=b->next) |
|
109 |
- if (b->type==HDR_VIA) { |
|
110 |
- for(a=b->before;a;) |
|
111 |
- {c=a->before;free_lump(a);pkg_free(a);a=c;} |
|
112 |
- for(a=b->after;a;) |
|
113 |
- {c=a->after;free_lump(a);pkg_free(a);a=c;} |
|
114 |
- if (b1) b1->next = b->next; |
|
115 |
- else i_req->add_rm = b->next; |
|
116 |
- free_lump(b);pkg_free(b); |
|
117 |
- } |
|
118 |
-#endif |
|
119 | 96 |
free_via_lump(&i_req->add_rm); |
120 | 97 |
|
121 | 98 |
shbuf=(char *)shm_malloc(*len); |
... | ... |
@@ -51,6 +51,7 @@ |
51 | 51 |
* |
52 | 52 |
* History: |
53 | 53 |
* ---------- |
54 |
+ * 2003-02-28 scratchpad compatibility abandoned (jiri) |
|
54 | 55 |
* 2003-02-27 3261 ACK/200 consumption bug removed (jiri) |
55 | 56 |
* 2003-01-28 scratchpad removed (jiri) |
56 | 57 |
* 2003-01-27 next baby-step to removing ZT - PRESERVE_ZT (jiri) |
... | ... |
@@ -90,20 +91,6 @@ |
90 | 91 |
#define EQ_REQ_URI_LEN\ |
91 | 92 |
(p_msg->first_line.u.request.uri.len==t_msg->first_line.u.request.uri.len) |
92 | 93 |
|
93 |
-#ifdef SCRATCH |
|
94 |
-#define EQ_STR(_hf) (memcmp(t_msg->_hf->body.s,\ |
|
95 |
- translate_pointer(p_msg->orig,p_msg->buf,p_msg->_hf->body.s), \ |
|
96 |
- p_msg->_hf->body.len)==0) |
|
97 |
-#define EQ_REQ_URI_STR\ |
|
98 |
- ( memcmp( t_msg->first_line.u.request.uri.s,\ |
|
99 |
- translate_pointer(p_msg->orig,p_msg->buf,p_msg->first_line.u.request.uri.s),\ |
|
100 |
- p_msg->first_line.u.request.uri.len)==0) |
|
101 |
-#define EQ_VIA_STR(_via)\ |
|
102 |
- ( memcmp( t_msg->_via->name.s,\ |
|
103 |
- translate_pointer(p_msg->orig,p_msg->buf,p_msg->_via->name.s),\ |
|
104 |
- (t_msg->via1->bsize-(t_msg->_via->name.s-(t_msg->_via->hdr.s+t_msg->_via->hdr.len)))\ |
|
105 |
- )==0 ) |
|
106 |
-#else /* SCRATCH */ |
|
107 | 94 |
#define EQ_STR(_hf) (memcmp(t_msg->_hf->body.s,\ |
108 | 95 |
p_msg->_hf->body.s, \ |
109 | 96 |
p_msg->_hf->body.len)==0) |
... | ... |
@@ -116,15 +103,10 @@ |
116 | 103 |
p_msg->_via->name.s,\ |
117 | 104 |
(t_msg->via1->bsize-(t_msg->_via->name.s-(t_msg->_via->hdr.s+t_msg->_via->hdr.len)))\ |
118 | 105 |
)==0 ) |
119 |
-#endif /* SCRATCH */ |
|
120 | 106 |
|
121 | 107 |
|
122 | 108 |
|
123 |
-#ifdef PRESERVE_ZT |
|
124 |
-#define HF_LEN(_hf) ((_hf)->body.s+(_hf)->body.len-(_hf)->name.s) |
|
125 |
-#else |
|
126 | 109 |
#define HF_LEN(_hf) ((_hf)->len) |
127 |
-#endif |
|
128 | 110 |
|
129 | 111 |
/* should be request-uri matching used as a part of pre-3261 |
130 | 112 |
* transaction matching, as the standard wants us to do so |
... | ... |
@@ -145,10 +127,6 @@ static struct cell *t_ack; |
145 | 127 |
break ref_counting |
146 | 128 |
*/ |
147 | 129 |
|
148 |
-#ifdef _OBSOLETED |
|
149 |
-struct cell *T; |
|
150 |
-#endif |
|
151 |
- |
|
152 | 130 |
static struct cell *T; |
153 | 131 |
|
154 | 132 |
/* number of currently processed message; good to know |
... | ... |
@@ -577,11 +555,6 @@ int t_reply_matching( struct sip_msg *p_msg , int *p_branch ) |
577 | 555 |
p=p_msg->via1->branch->value.s+MCOOKIE_LEN; |
578 | 556 |
scan_space=p_msg->via1->branch->value.len-MCOOKIE_LEN; |
579 | 557 |
|
580 |
-#ifdef OBSOLETED |
|
581 |
- p=p_msg->via1->branch->value.s; |
|
582 |
- scan_space=p_msg->via1->branch->value.len; |
|
583 |
-#endif |
|
584 |
- |
|
585 | 558 |
|
586 | 559 |
/* hash_id */ |
587 | 560 |
n=eat_token2_end( p, p+scan_space, BRANCH_SEPARATOR); |
... | ... |
@@ -29,6 +29,7 @@ |
29 | 29 |
* |
30 | 30 |
* History: |
31 | 31 |
* ---------- |
32 |
+ * 2003-02-28 scratchpad compatibility abandoned (jiri) |
|
32 | 33 |
* 2003-01-27 next baby-step to removing ZT - PRESERVE_ZT (jiri) |
33 | 34 |
* 2003-02-13 build_uac_request uses proto (andrei) |
34 | 35 |
*/ |
... | ... |
@@ -102,28 +103,15 @@ char *build_local(struct cell *Trans,unsigned int branch, |
102 | 103 |
} |
103 | 104 |
*len+= via_len; |
104 | 105 |
/*headers*/ |
105 |
-#ifdef PRESERVE_ZT |
|
106 |
- *len+=Trans->from.len+CRLF_LEN |
|
107 |
- +Trans->callid.len+CRLF_LEN |
|
108 |
- +to->len+CRLF_LEN |
|
109 |
- /* CSeq: 101 CANCEL */ |
|
110 |
- +Trans->cseq_n.len+1+method_len+CRLF_LEN; |
|
111 |
-#else |
|
112 | 106 |
*len+=Trans->from.len+Trans->callid.len+to->len+ |
113 | 107 |
+Trans->cseq_n.len+1+method_len+CRLF_LEN; |
114 |
-#endif |
|
115 | 108 |
|
116 | 109 |
|
117 | 110 |
/* copy'n'paste Route headers */ |
118 | 111 |
if (!Trans->local) { |
119 | 112 |
for ( hdr=Trans->uas.request->headers ; hdr ; hdr=hdr->next ) |
120 | 113 |
if (hdr->type==HDR_ROUTE) |
121 |
-#ifdef PRESERVE_ZT |
|
122 |
- *len+=((hdr->body.s+hdr->body.len ) - hdr->name.s ) + |
|
123 |
- CRLF_LEN ; |
|
124 |
-#else |
|
125 | 114 |
*len+=hdr->len; |
126 |
-#endif |
|
127 | 115 |
} |
128 | 116 |
|
129 | 117 |
/* User Agent */ |
... | ... |
@@ -150,18 +138,10 @@ char *build_local(struct cell *Trans,unsigned int branch, |
150 | 138 |
append_mem_block(p,via,via_len); |
151 | 139 |
|
152 | 140 |
/*other headers*/ |
153 |
-#ifdef PRESERVE_ZT |
|
154 | 141 |
append_str( p, Trans->from ); |
155 |
- append_mem_block( p, CRLF, CRLF_LEN ); |
|
156 | 142 |
append_str( p, Trans->callid ); |
157 |
- append_mem_block( p, CRLF, CRLF_LEN ); |
|
158 | 143 |
append_str( p, *to ); |
159 |
- append_mem_block( p, CRLF, CRLF_LEN ); |
|
160 |
-#else |
|
161 |
- append_str( p, Trans->from ); |
|
162 |
- append_str( p, Trans->callid ); |
|
163 |
- append_str( p, *to ); |
|
164 |
-#endif |
|
144 |
+ |
|
165 | 145 |
append_str( p, Trans->cseq_n ); |
166 | 146 |
append_mem_block( p, " ", 1 ); |
167 | 147 |
append_mem_block( p, method, method_len ); |
... | ... |
@@ -170,13 +150,7 @@ char *build_local(struct cell *Trans,unsigned int branch, |
170 | 150 |
if (!Trans->local) { |
171 | 151 |
for ( hdr=Trans->uas.request->headers ; hdr ; hdr=hdr->next ) |
172 | 152 |
if(hdr->type==HDR_ROUTE) { |
173 |
-#ifdef PRESERVE_ZT |
|
174 |
- append_mem_block(p, hdr->name.s, |
|
175 |
- hdr->body.s+hdr->body.len-hdr->name.s ); |
|
176 |
- append_mem_block(p, CRLF, CRLF_LEN ); |
|
177 |
-#else |
|
178 | 153 |
append_mem_block(p, hdr->name.s, hdr->len ); |
179 |
-#endif |
|
180 | 154 |
} |
181 | 155 |
} |
182 | 156 |
|
... | ... |
@@ -198,161 +172,6 @@ error: |
198 | 172 |
} |
199 | 173 |
|
200 | 174 |
|
201 |
-#ifndef DEPRECATE_OLD_STUFF |
|
202 |
-char *build_uac_request( str msg_type, str dst, str from, |
|
203 |
- str fromtag, int cseq, str callid, str headers, |
|
204 |
- str body, int branch, |
|
205 |
- struct cell *t, unsigned int *len) |
|
206 |
-{ |
|
207 |
- char *via; |
|
208 |
- unsigned int via_len; |
|
209 |
- char content_len[10]; |
|
210 |
- int content_len_len; |
|
211 |
- char cseq_str[10]; |
|
212 |
- int cseq_str_len; |
|
213 |
- char *buf; |
|
214 |
- char *w; |
|
215 |
-#ifdef _OBSOLETED |
|
216 |
- int dummy; |
|
217 |
-#endif |
|
218 |
- |
|
219 |
- char branch_buf[MAX_BRANCH_PARAM_LEN]; |
|
220 |
- int branch_len; |
|
221 |
- str branch_str; |
|
222 |
- |
|
223 |
- int from_len; |
|
224 |
- char *from_str; |
|
225 |
- |
|
226 |
- buf=0; |
|
227 |
- |
|
228 |
- /* print content length */ |
|
229 |
- content_len_len=snprintf( |
|
230 |
- content_len, sizeof(content_len), |
|
231 |
- "%d", body.len ); |
|
232 |
- if (content_len_len==-1 || content_len_len>=sizeof(content_len)) { |
|
233 |
- LOG(L_ERR, "ERROR: uac: content_len too big\n"); |
|
234 |
- return 0; |
|
235 |
- } |
|
236 |
- /* print cseq */ |
|
237 |
- cseq_str_len=snprintf( |
|
238 |
- cseq_str, sizeof(cseq_str), |
|
239 |
- "%d", cseq ); |
|
240 |
- if (cseq_str_len==-1 || cseq_str_len>=sizeof(cseq_str)) { |
|
241 |
- LOG(L_ERR, "ERROR: uac: cseq too big\n"); |
|
242 |
- return 0; |
|
243 |
- } |
|
244 |
- |
|
245 |
- if (from.len) { |
|
246 |
- from_len=from.len; |
|
247 |
- from_str=from.s; |
|
248 |
- } else { |
|
249 |
- from_len=strlen(uac_from); |
|
250 |
- from_str=uac_from; |
|
251 |
- } |
|
252 |
- |
|
253 |
- *len=SIP_VERSION_LEN+msg_type.len+2/*spaces*/+CRLF_LEN+ |
|
254 |
- dst.len; |
|
255 |
- |
|
256 |
- if (!t_calc_branch(t, branch, branch_buf, &branch_len )) { |
|
257 |
- LOG(L_ERR, "ERROR: build_uac_request: branch calculation failed\n"); |
|
258 |
- goto error; |
|
259 |
- } |
|
260 |
- branch_str.s=branch_buf; |
|
261 |
- branch_str.len=branch_len; |
|
262 |
- |
|
263 |
- via=via_builder(&via_len, t->uac[branch].request.send_sock, |
|
264 |
- &branch_str, 0, t->uac[branch].request.dst.proto); |
|
265 |
- |
|
266 |
- if (!via) { |
|
267 |
- LOG(L_ERR, "ERROR: build_uac_request: via building failed\n"); |
|
268 |
- goto error; |
|
269 |
- } |
|
270 |
- *len+=via_len; |
|
271 |
- /* header names and separators */ |
|
272 |
- *len+= |
|
273 |
- +CSEQ_LEN+CRLF_LEN |
|
274 |
- +TO_LEN+CRLF_LEN |
|
275 |
- +CALLID_LEN+CRLF_LEN |
|
276 |
- +CONTENT_LENGTH_LEN+CRLF_LEN |
|
277 |
- + (server_signature ? USER_AGENT_LEN + CRLF_LEN : 0 ) |
|
278 |
- +FROM_LEN+CRLF_LEN |
|
279 |
- +CRLF_LEN; /* EoM */ |
|
280 |
- /* header field value and body length */ |
|
281 |
- *len+= msg_type.len+1+cseq_str_len /* CSeq: method, delimitor, number */ |
|
282 |
- + dst.len /* To */ |
|
283 |
- + callid.len /* call-id */ |
|
284 |
- + from_len+FROMTAG_LEN+fromtag.len |
|
285 |
- + content_len_len |
|
286 |
- + headers.len |
|
287 |
- + body.len; |
|
288 |
- |
|
289 |
- buf=shm_malloc( *len+1 ); |
|
290 |
- if (!buf) { |
|
291 |
- LOG(L_ERR, "ERROR: t_uac: no shmem\n"); |
|
292 |
- goto error1; |
|
293 |
- } |
|
294 |
- w=buf; |
|
295 |
- memapp( w, msg_type.s, msg_type.len ); |
|
296 |
- memapp( w, " ", 1); |
|
297 |
- t->uac[branch].uri.s=w; t->uac[branch].uri.len=dst.len; |
|
298 |
- memapp( w, dst.s, dst.len ); |
|
299 |
- memapp( w, " " SIP_VERSION CRLF, 1+SIP_VERSION_LEN+CRLF_LEN ); |
|
300 |
- memapp( w, via, via_len ); |
|
301 |
- |
|
302 |
- /* CSeq */ |
|
303 |
- t->cseq_n.s=w; |
|
304 |
- t->cseq_n.len=CSEQ_LEN+cseq_str_len; |
|
305 |
- memapp(w, CSEQ, CSEQ_LEN ); |
|
306 |
- memapp(w, cseq_str, cseq_str_len ); |
|
307 |
- memapp(w, " ", 1 ); |
|
308 |
- |
|
309 |
- memapp( w, msg_type.s, msg_type.len ); |
|
310 |
- t->to.s=w+CRLF_LEN; t->to.len=TO_LEN+dst.len; |
|
311 |
- memapp( w, CRLF TO, CRLF_LEN + TO_LEN ); |
|
312 |
- memapp( w, dst.s, dst.len ); |
|
313 |
- t->callid.s=w+CRLF_LEN; t->callid.len=callid.len; |
|
314 |
- memapp( w, CRLF CALLID, CRLF_LEN + CALLID_LEN ); |
|
315 |
- memapp( w, callid.s, callid.len ); |
|
316 |
- memapp( w, CRLF CONTENT_LENGTH, CRLF_LEN + CONTENT_LENGTH_LEN); |
|
317 |
- memapp( w, content_len, content_len_len ); |
|
318 |
- if (server_signature) { |
|
319 |
- memapp( w, CRLF USER_AGENT CRLF FROM, |
|
320 |
- CRLF_LEN+USER_AGENT_LEN+CRLF_LEN+FROM_LEN); |
|
321 |
- } else { |
|
322 |
- memapp( w, CRLF FROM, |
|
323 |
- CRLF_LEN+FROM_LEN); |
|
324 |
- } |
|
325 |
- t->from.s=w-FROM_LEN; |
|
326 |
- t->from.len=FROM_LEN+from_len+FROMTAG_LEN+fromtag.len; |
|
327 |
- memapp( w, from_str, from_len ); |
|
328 |
- memapp( w, FROMTAG, FROMTAG_LEN ); |
|
329 |
- memapp( w, fromtag.s, fromtag.len ); |
|
330 |
- memapp( w, CRLF, CRLF_LEN ); |
|
331 |
- |
|
332 |
- memapp( w, headers.s, headers.len ); |
|
333 |
- /* EoH */ |
|
334 |
- memapp( w, CRLF, CRLF_LEN ); |
|
335 |
- if ( body.s ) { |
|
336 |
- memapp( w, body.s, body.len ); |
|
337 |
- } |
|
338 |
-#ifdef _OBSOLETED |
|
339 |
- /* ugly HACK -- debugging has shown len shorter by one */ |
|
340 |
- dummy=*len+1; |
|
341 |
- *len=dummy; |
|
342 |
-#endif |
|
343 |
-# ifdef EXTRA_DEBUG |
|
344 |
- if (w-buf != *len ) abort(); |
|
345 |
-# endif |
|
346 |
- |
|
347 |
- |
|
348 |
-error1: |
|
349 |
- pkg_free(via); |
|
350 |
-error: |
|
351 |
- return buf; |
|
352 |
- |
|
353 |
-} |
|
354 |
-#endif |
|
355 |
- |
|
356 | 175 |
|
357 | 176 |
char *build_uac_request_dlg(str* msg, /* Method */ |
358 | 177 |
str* ruri, /* Request-URI */ |
... | ... |
@@ -48,13 +48,6 @@ |
48 | 48 |
#define TOTAG ";tag=" |
49 | 49 |
#define TOTAG_LEN (sizeof(TOTAG)-1) |
50 | 50 |
|
51 |
-#ifdef _OBSOLETED |
|
52 |
-#define UAC_CSEQNR "1" |
|
53 |
-#define UAC_CSEQNR_LEN 1 |
|
54 |
-#define CONTENT_LENGTH "Content-Length: " |
|
55 |
-#define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1) |
|
56 |
-#endif |
|
57 |
- |
|
58 | 51 |
|
59 | 52 |
/* convenience macros */ |
60 | 53 |
#define memapp(_d,_s,_len) \ |
... | ... |
@@ -69,14 +62,6 @@ |
69 | 62 |
(_d) += (_len);\ |
70 | 63 |
}while(0); |
71 | 64 |
|
72 |
-#ifdef _OBSO |
|
73 |
-#define append_str(_p,_str) \ |
|
74 |
- do{ \ |
|
75 |
- memcpy((_p), (_str).s, (_str).len); \ |
|
76 |
- (_p)+=(_str).len); \ |
|
77 |
- } while(0); |
|
78 |
-#endif |
|
79 |
- |
|
80 | 65 |
char *build_local(struct cell *Trans, unsigned int branch, |
81 | 66 |
unsigned int *len, char *method, int method_len, str *to); |
82 | 67 |
|
... | ... |
@@ -27,6 +27,7 @@ |
27 | 27 |
* |
28 | 28 |
* History: |
29 | 29 |
* -------- |
30 |
+ * 2003-02-28 scratchpad compatibility abandoned (jiri) |
|
30 | 31 |
* 2003-01-27 next baby-step to removing ZT - PRESERVE_ZT (jiri) |
31 | 32 |
* 2003-01-19 faked lump list created in on_reply handlers |
32 | 33 |
* 2003-02-13 updated to use rb->dst (andrei) |
... | ... |
@@ -111,13 +112,8 @@ static char *build_ack(struct sip_msg* rpl,struct cell *trans,int branch, |
111 | 112 |
"cannot generate a HBH ACK if key HFs in reply missing\n"); |
112 | 113 |
return NULL; |
113 | 114 |
} |
114 |
-#ifdef PRESERVE_ZT |
|
115 |
- to.len=rpl->to->body.s+rpl->to->body.len-rpl->to->name.s; |
|
116 |
- to.s=rpl->orig+(rpl->to->name.s-rpl->buf); |
|
117 |
-#else |
|
118 | 115 |
to.s=rpl->to->name.s; |
119 | 116 |
to.len=rpl->to->len; |
120 |
-#endif |
|
121 | 117 |
return build_local( trans, branch, ret_len, |
122 | 118 |
ACK, ACK_LEN, &to ); |
123 | 119 |
} |
... | ... |
@@ -218,40 +214,6 @@ restore: |
218 | 214 |
return 0; |
219 | 215 |
} |
220 | 216 |
|
221 |
-#ifdef _OBSOLETED |
|
222 |
-void on_negative_reply( struct cell* t, struct sip_msg* msg, |
|
223 |
- int code, void *param ) |
|
224 |
-{ |
|
225 |
- int act_ret; |
|
226 |
- struct sip_msg faked_msg; |
|
227 |
- |
|
228 |
- /* nobody cares about a negative transaction -- ok, return */ |
|
229 |
- if (!t->on_negative) { |
|
230 |
- DBG("DBG: on_negative_reply: no on_negative\n"); |
|
231 |
- return; |
|
232 |
- } |
|
233 |
- |
|
234 |
- DBG("DBG: on_negative_reply processed for transaction %p\n", t); |
|
235 |
- if (!faked_env(&faked_msg, t, t->uas.request, 0 /* create fake */ )) { |
|
236 |
- LOG(L_ERR, "ERROR: on_negative_reply: faked_env failed\n"); |
|
237 |
- goto restore; |
|
238 |
- } |
|
239 |
- |
|
240 |
- /* run */ |
|
241 |
- act_ret=run_actions(reply_rlist[t->on_negative], &faked_msg ); |
|
242 |
- if (act_ret<0) { |
|
243 |
- LOG(L_ERR, "ERROR: on_negative_reply: Error in do_action\n"); |
|
244 |
- } |
|
245 |
- |
|
246 |
- |
|
247 |
-restore: |
|
248 |
- faked_env(&faked_msg, 0, 0 /* don't need t and shmem_rq */ , |
|
249 |
- 1 /* restore fake */ ); |
|
250 |
- |
|
251 |
-} |
|
252 |
-#endif |
|
253 |
- |
|
254 |
- |
|
255 | 217 |
|
256 | 218 |
|
257 | 219 |
/* the main code of stateful replying */ |
... | ... |
@@ -1074,11 +1036,6 @@ int t_on_reply( struct sip_msg *p_msg ) |
1074 | 1036 |
} /* provisional replies */ |
1075 | 1037 |
|
1076 | 1038 |
done: |
1077 |
-#ifdef _OBSOLETED |
|
1078 |
- /* moved to script callback */ |
|
1079 |
- UNREF( t ); |
|
1080 |
- T=T_UNDEFINED; |
|
1081 |
-#endif |
|
1082 | 1039 |
/* don't try to relay statelessly neither on success |
1083 | 1040 |
(we forwarded statefuly) nor on error; on troubles, |
1084 | 1041 |
simply do nothing; that will make the other party to |
... | ... |
@@ -109,10 +109,6 @@ int t_reply( struct cell *t, struct sip_msg * , unsigned int , char * ); |
109 | 109 |
*/ |
110 | 110 |
int t_reply_unsafe( struct cell *t, struct sip_msg * , unsigned int , char * ); |
111 | 111 |
|
112 |
-#ifdef _OBSOLETED |
|
113 |
-void cleanup_after_final( struct s_table *h_table, struct cell *t, |
|
114 |
- unsigned int status ); |
|
115 |
-#endif |
|
116 | 112 |
|
117 | 113 |
enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch, |
118 | 114 |
unsigned int msg_status, branch_bm_t *cancel_bitmap ); |
... | ... |
@@ -684,14 +684,6 @@ void reset_timer( struct timer_link* tl ) |
684 | 684 |
#ifdef EXTRA_DEBUG |
685 | 685 |
DBG("DEBUG: reset_timer (group %d, tl=%p)\n", tl->tg, tl ); |
686 | 686 |
#endif |
687 |
-#ifdef _OBSOLETED |
|
688 |
- /* lock(timer_group_lock[ tl->tg ]); */ |
|
689 |
- /* hack to work arround this timer group thing*/ |
|
690 |
- lock(hash__XX_table->timers[timer_group[tl->tg]].mutex); |
|
691 |
- remove_timer_unsafe( tl ); |
|
692 |
- unlock(hash_XX_table->timers[timer_group[tl->tg]].mutex); |
|
693 |
- /*unlock(timer_group_lock[ tl->tg ]);*/ |
|
694 |
-#endif |
|
695 | 687 |
} |
696 | 688 |
|
697 | 689 |
|
... | ... |
@@ -90,9 +90,7 @@ |
90 | 90 |
|
91 | 91 |
inline static int w_t_check(struct sip_msg* msg, char* str, char* str2); |
92 | 92 |
inline static int w_t_reply(struct sip_msg* msg, char* str, char* str2); |
93 |
-#ifdef _OBSOLETED |
|
94 |
-inline static int w_t_reply_unsafe(struct sip_msg* msg, char* str, char* str2); |
|
95 |
-#endif |
|
93 |
+ |
|
96 | 94 |
inline static int w_t_release(struct sip_msg* msg, char* str, char* str2); |
97 | 95 |
inline static int fixup_t_send_reply(void** param, int param_no); |
98 | 96 |
inline static int fixup_str2int( void** param, int param_no); |
... | ... |
@@ -139,9 +137,6 @@ struct module_exports exports= { |
139 | 137 |
"t_newtran", |
140 | 138 |
"t_lookup_request", |
141 | 139 |
T_REPLY, |
142 |
-#ifdef _OBSO |
|
143 |
- T_REPLY_UNSAFE, |
|
144 |
-#endif |
|
145 | 140 |
"t_retransmit_reply", |
146 | 141 |
"t_release", |
147 | 142 |
T_RELAY_TO, |
... | ... |
@@ -161,9 +156,6 @@ struct module_exports exports= { |
161 | 156 |
/* not applicable from script ... */ |
162 | 157 |
|
163 | 158 |
"register_tmcb", |
164 |
-#ifndef DEPRECATE_OLD_STUFF |
|
165 |
- T_UAC, |
|
166 |
-#endif |
|
167 | 159 |
T_UAC_DLG, |
168 | 160 |
"load_tm", |
169 | 161 |
#ifdef VOICE_MAIL |
... | ... |
@@ -178,9 +170,6 @@ struct module_exports exports= { |
178 | 170 |
w_t_newtran, |
179 | 171 |
w_t_check, |
180 | 172 |
w_t_reply, |
181 |
-#ifdef _OBSO |
|
182 |
- w_t_reply_unsafe, |
|
183 |
-#endif |
|
184 | 173 |
w_t_retransmit_reply, |
185 | 174 |
w_t_release, |
186 | 175 |
w_t_relay_to, |
... | ... |
@@ -198,9 +187,6 @@ struct module_exports exports= { |
198 | 187 |
w_t_on_negative, |
199 | 188 |
|
200 | 189 |
(cmd_function) register_tmcb, |
201 |
-#ifndef DEPRECATE_OLD_STUFF |
|
202 |
- (cmd_function) t_uac, |
|
203 |
-#endif |
|
204 | 190 |
(cmd_function) t_uac_dlg, |
205 | 191 |
(cmd_function) load_tm, |
206 | 192 |
#ifdef VOICE_MAIL |
... | ... |
@@ -215,9 +201,6 @@ struct module_exports exports= { |
215 | 201 |
0, /* t_newtran */ |
216 | 202 |
0, /* t_lookup_request */ |
217 | 203 |
2, /* t_reply */ |
218 |
-#ifdef _OBSO |
|
219 |
- 2, /* t_reply_unsafe */ |
|
220 |
-#endif |
|
221 | 204 |
0, /* t_retransmit_reply */ |
222 | 205 |
0, /* t_release */ |
223 | 206 |
2, /* t_relay_to */ |
... | ... |
@@ -234,9 +217,6 @@ struct module_exports exports= { |
234 | 217 |
2, /* t_forward_nonack_tcp */ |
235 | 218 |
1, /* t_on_negative */ |
236 | 219 |
NO_SCRIPT /* register_tmcb */, |
237 |
-#ifndef DEPRECATE_OLD_STUFF |
|
238 |
- NO_SCRIPT /* t_uac */, |
|
239 |
-#endif |
|
240 | 220 |
NO_SCRIPT /* t_uac_dlg */, |
241 | 221 |
NO_SCRIPT /* load_tm */, |
242 | 222 |
#ifdef VOICE_MAIL |
... | ... |
@@ -251,9 +231,6 @@ struct module_exports exports= { |
251 | 231 |
0, /* t_newtran */ |
252 | 232 |
0, /* t_lookup_request */ |
253 | 233 |
fixup_t_send_reply, /* t_reply */ |
254 |
-#ifdef _OBSO |
|
255 |
- fixup_t_send_reply, /* t_reply_unsafe */ |
|
256 |
-#endif |
|
257 | 234 |
0, /* t_retransmit_reply */ |
258 | 235 |
0, /* t_release */ |
259 | 236 |
fixup_hostport2proxy, /* t_relay_to */ |
... | ... |
@@ -270,9 +247,6 @@ struct module_exports exports= { |
270 | 247 |
fixup_hostport2proxy, /* t_forward_nonack_tcp */ |
271 | 248 |
fixup_str2int, /* t_on_negative */ |
272 | 249 |
0, /* register_tmcb */ |
273 |
-#ifndef DEPRECATE_OLD_STUFF |
|
274 |
- 0, /* t_uac */ |
|
275 |
-#endif |
|
276 | 250 |
0, /* t_uac_dlg */ |
277 | 251 |
0, /* load_tm */ |
278 | 252 |
#ifdef VOICE_MAIL |
... | ... |
@@ -284,12 +258,6 @@ struct module_exports exports= { |
284 | 258 |
0 /* t_newdlg */ |
285 | 259 |
|
286 | 260 |
}, |
287 |
-#ifndef DEPRECATE_OLD_STUFF |
|
288 |
- 1+ |
|
289 |
-#endif |
|
290 |
-#ifdef _OBSO |
|
291 |
- 1+ |
|
292 |
-#endif |
|
293 | 261 |
#ifdef VOICE_MAIL |
294 | 262 |
4+ |
295 | 263 |
#endif |
... | ... |
@@ -307,9 +275,6 @@ struct module_exports exports= { |
307 | 275 |
"retr_timer1p3", |
308 | 276 |
"retr_timer2", |
309 | 277 |
"noisy_ctimer" |
310 |
-#ifndef DEPRECATE_OLD_STUFF |
|
311 |
- ,"uac_from" |
|
312 |
-#endif |
|
313 | 278 |
}, |
314 | 279 |
(modparam_t[]) { /* variable types */ |
315 | 280 |
INT_PARAM, /* ruri_matching */ |
... | ... |
@@ -322,9 +287,6 @@ struct module_exports exports= { |
322 | 287 |
INT_PARAM, /* retr_timer1p3 */ |
323 | 288 |
INT_PARAM, /* retr_timer2 */ |
324 | 289 |
INT_PARAM /* noisy_ctimer */ |
325 |
-#ifndef DEPRECATE_OLD_STUFF |
|
326 |
- ,STR_PARAM /* uac_from */ |
|
327 |
-#endif |
|
328 | 290 |
}, |
329 | 291 |
(void *[]) { /* variable pointers */ |
330 | 292 |
&ruri_matching, |
... | ... |
@@ -337,13 +299,7 @@ struct module_exports exports= { |
337 | 299 |
&(timer_id2timeout[RT_T1_TO_3]), |
338 | 300 |
&(timer_id2timeout[RT_T2]), |
339 | 301 |
&noisy_ctimer |
340 |
-#ifndef DEPRECATE_OLD_STUFF |
|
341 |
- ,&uac_from |
|
342 |
-#endif |
|
343 | 302 |
}, |
344 |
-#ifndef DEPRECATE_OLD_STUFF |
|
345 |
- 1+ |
|
346 |
-#endif |
|
347 | 303 |
10, /* Number of module paramers */ |
348 | 304 |
|
349 | 305 |
mod_init, /* module initialization function */ |
... | ... |
@@ -406,16 +362,6 @@ static int mod_init(void) |
406 | 362 |
} |
407 | 363 |
|
408 | 364 |
|
409 |
-#ifndef DEPRECATE_OLD_STUFF |
|
410 |
- if (register_fifo_cmd(fifo_uac, "t_uac", 0)<0) { |
|
411 |
- LOG(L_CRIT, "cannot register fifo uac\n"); |
|
412 |
- return -1; |
|
413 |
- } |
|
414 |
- if (register_fifo_cmd(fifo_uac_from, "t_uac_from", 0)<0) { |
|
415 |
- LOG(L_CRIT, "cannot register fifo uac\n"); |
|
416 |
- return -1; |
|
417 |
- } |
|
418 |
-#endif |
|
419 | 365 |
if (register_fifo_cmd(fifo_uac_dlg, "t_uac_dlg", 0)<0) { |
420 | 366 |
LOG(L_CRIT, "cannot register fifo uac\n"); |
421 | 367 |
return -1; |
... | ... |
@@ -459,10 +405,6 @@ static int mod_init(void) |
459 | 405 |
LOG(L_ERR, "ERROR: mod_init: uac_init failed\n"); |
460 | 406 |
return -1; |
461 | 407 |
} |
462 |
-#ifdef _OBSO |
|
463 |
- register_tmcb( TMCB_ON_NEGATIVE, on_negative_reply, |
|
464 |
- 0 /* empty param */); |
|
465 |
-#endif |
|
466 | 408 |
/* register post-script clean-up function */ |
467 | 409 |
register_script_cb( w_t_unref, POST_SCRIPT_CB, |
468 | 410 |
0 /* empty param */ ); |
... | ... |
@@ -625,26 +567,6 @@ inline static int w_t_reply(struct sip_msg* msg, char* str, char* str2) |
625 | 567 |
} |
626 | 568 |
} |
627 | 569 |
|
628 |
-#ifdef _OBSOLETED |
|
629 |
-inline static int w_t_reply_unsafe(struct sip_msg* msg, char* str, char* str2) |
|
630 |
-{ |
|
631 |
- struct cell *t; |
|
632 |
- |
|
633 |
- if (msg->REQ_METHOD==METHOD_ACK) { |
|
634 |
- LOG(L_WARN, "WARNING: t_reply: ACKs are not replied\n"); |
|
635 |
- return -1; |
|
636 |
- } |
|
637 |
- if (t_check( msg , 0 )==-1) return -1; |
|
638 |
- t=get_t(); |
|
639 |
- if (!t) { |
|
640 |
- LOG(L_ERR, "ERROR: t_reply: cannot send a t_reply to a message " |
|
641 |
- "for which no T-state has been established\n"); |
|
642 |
- return -1; |
|
643 |
- } |
|
644 |
- return t_reply_unsafe(t, msg, (unsigned int) str, str2); |
|
645 |
-} |
|
646 |
-#endif |
|
647 |
- |
|
648 | 570 |
|
649 | 571 |
inline static int w_t_release(struct sip_msg* msg, char* str, char* str2) |
650 | 572 |
{ |
... | ... |
@@ -49,12 +49,6 @@ int load_tm( struct tm_binds *tmb) |
49 | 49 |
LOG(L_ERR, LOAD_ERROR "'t_relay' not found\n"); |
50 | 50 |
return -1; |
51 | 51 |
} |
52 |
-#ifndef DEPRECATE_OLD_STUFF |
|
53 |
- if (!(tmb->t_uac=(tuac_f)find_export(T_UAC, NO_SCRIPT)) ) { |
|
54 |
- LOG( L_ERR, LOAD_ERROR "'t_uac' not found\n"); |
|
55 |
- return -1; |
|
56 |
- } |
|
57 |
-#endif |
|
58 | 52 |
if (!(tmb->t_uac_dlg=(tuacdlg_f)find_export(T_UAC_DLG, NO_SCRIPT)) ) { |
59 | 53 |
LOG( L_ERR, LOAD_ERROR "'t_uac_dlg' not found\n"); |
60 | 54 |
return -1; |
... | ... |
@@ -80,12 +74,6 @@ int load_tm( struct tm_binds *tmb) |
80 | 74 |
LOG( L_ERR, LOAD_ERROR "'t_lookup_ident' not found\n"); |
81 | 75 |
return -1; |
82 | 76 |
} |
83 |
-#endif |
|
84 |
-#ifdef _OBSO |
|
85 |
- if (!(tmb->t_reply_unsafe=(treply_f)find_export(T_REPLY_UNSAFE, 2)) ) { |
|
86 |
- LOG( L_ERR, LOAD_ERROR "'t_reply_unsafe' not found\n"); |
|
87 |
- return -1; |
|
88 |
- } |
|
89 | 77 |
#endif |
90 | 78 |
if (!(tmb->t_forward_nonack=(tfwd_f)find_export(T_FORWARD_NONACK , 2)) ) { |
91 | 79 |
LOG( L_ERR, LOAD_ERROR "'t_forward_nonack' not found\n"); |
... | ... |
@@ -50,9 +50,6 @@ |
50 | 50 |
#define T_RELAY "t_relay" |
51 | 51 |
#define T_RELAY_UDP "t_relay_udp" |
52 | 52 |
#define T_RELAY_TCP "t_relay_tcp" |
53 |
-#ifndef DEPRECATE_OLD_STUFF |
|
54 |
-# define T_UAC "t_uac" |
|
55 |
-#endif |
|
56 | 53 |
#define T_UAC_DLG "t_uac_dlg" |
57 | 54 |
#define T_REPLY "t_reply" |
58 | 55 |
#ifdef VOICE_MAIL |
... | ... |
@@ -69,9 +66,6 @@ struct tm_binds { |
69 | 66 |
register_tmcb_f register_tmcb; |
70 | 67 |
cmd_function t_relay_to; |
71 | 68 |
cmd_function t_relay; |
72 |
-#ifndef DEPRECATE_OLD_STUFF |
|
73 |
- tuac_f t_uac; |
|
74 |
-#endif |
|
75 | 69 |
tuacdlg_f t_uac_dlg; |
76 | 70 |
treply_f t_reply; |
77 | 71 |
#ifdef VOICE_MAIL |
... | ... |
@@ -44,6 +44,7 @@ |
44 | 44 |
* |
45 | 45 |
* History: |
46 | 46 |
* -------- |
47 |
+ * 2003-02-28 scratchpad compatibility abandoned (jiri) |
|
47 | 48 |
* 2003-02-27 FIFO/UAC now dumps reply -- good for CTD (jiri) |
48 | 49 |
* 2003-02-13 t_uac, t _uac_dlg, gethfblock, uri2proxy changed to use |
49 | 50 |
* proto & rb->dst (andrei) |
... | ... |
@@ -120,11 +121,6 @@ static int callid_suffix_len; |
120 | 121 |
static int rand_len; /* number of chars to display max rand */ |
121 | 122 |
static char callid[CALLID_NR_LEN+CALLID_SUFFIX_LEN]; |
122 | 123 |
|
123 |
-#ifndef DEPRECATE_OLD_STUFF |
|
124 |
-char *uac_from="\"UAC Account\" <sip:uac@dev.null:9>"; |
|
125 |
-str uac_from_str; |
|
126 |
-#endif |
|
127 |
- |
|
128 | 124 |
static char from_tag[ FROM_TAG_LEN+1 ]; |
129 | 125 |
|
130 | 126 |
|
... | ... |
@@ -186,11 +182,6 @@ int uac_init() { |
186 | 182 |
MDStringArray( from_tag, src, 3 ); |
187 | 183 |
from_tag[MD5_LEN]=CID_SEP; |
188 | 184 |
|
189 |
-#ifndef DEPRECATE_OLD_STUFF |
|
190 |
- uac_from_str.s = uac_from; |
|
191 |
- uac_from_str.len = strlen(uac_from); |
|
192 |
-#endif |
|
193 |
- |
|
194 | 185 |
return 1; |
195 | 186 |
} |
196 | 187 |
|
... | ... |
@@ -209,146 +200,6 @@ int uac_child_init( int rank ) |
209 | 200 |
return 1; |
210 | 201 |
} |
211 | 202 |
|
212 |
-#ifndef DEPRECATE_OLD_STUFF |
|
213 |
-int t_uac( str *msg_type, str *dst, int proto, |
|
214 |
- str *headers, str *body, str *from, |
|
215 |
- transaction_cb completion_cb, void *cbp, |
|
216 |
- dlg_t dlg) |
|
217 |
-{ |
|
218 |
- |
|
219 |
- int r; |
|
220 |
- struct cell *new_cell; |
|
221 |
- struct proxy_l *proxy; |
|
222 |
- int branch; |
|
223 |
- int ret; |
|
224 |
- unsigned int req_len; |
|
225 |
- char *buf; |
|
226 |
- union sockaddr_union to; |
|
227 |
- struct socket_info* send_sock; |
|
228 |
- struct retr_buf *request; |
|
229 |
- str dummy_from; |
|
230 |
- str callid_s; |
|
231 |
- str fromtag; |
|
232 |
- |
|
233 |
- /* make -Wall shut up */ |
|
234 |
- ret=0; |
|
235 |
- |
|
236 |
- proxy=uri2proxy( dst, proto ); |
|
237 |
- if (proxy==0) { |
|
238 |
- ser_error=ret=E_BAD_ADDRESS; |
|
239 |
- LOG(L_ERR, "ERROR: t_uac: can't create a dst proxy\n"); |
|
240 |
- goto done; |
|
241 |
- } |
|
242 |
- branch=0; |
|
243 |
- /* might go away -- we ignore it in send_pr_buffer anyway */ |
|
244 |
- /* T->uac[branch].request.to_len=sizeof(union sockaddr_union); */ |
|
245 |
- hostent2su(&to, &proxy->host, proxy->addr_idx, |
|
246 |
- (proxy->port)?htons(proxy->port):htons(SIP_PORT)); |
|
247 |
- /* send_sock=get_send_socket( &to, PROTO_UDP ); */ |
|
248 |
- send_sock=get_out_socket( &to, proto ); |
|
249 |
- if (send_sock==0) { |
|
250 |
- LOG(L_ERR, "ERROR: t_uac: no corresponding listening socket " |
|
251 |
- "for af %d\n", to.s.sa_family ); |
|
252 |
- ret=E_NO_SOCKET; |
|
253 |
- goto error00; |
|
254 |
- } |
|
255 |
- |
|
256 |
- /* update callid */ |
|
257 |
- /* generate_callid(); */ |
|
258 |
- callid_nr++; |
|
259 |
- r=snprintf(callid, rand_len+1, "%0*lx", rand_len, callid_nr ); |
|
260 |
- if (r==-1 || r>=rand_len+1) { |
|
261 |
- LOG(L_CRIT, "BUG: SORRY, callid calculation failed\n"); |
|
262 |
- goto error00; |
|
263 |
- } |
|
264 |
- /* fix the ZT 0 */ |
|
265 |
- callid[rand_len]=CID_SEP; |
|
266 |
- callid_s.s=callid; |
|
267 |
- callid_s.len=rand_len+callid_suffix_len; |
|
268 |
- DBG("DEBUG: sufix_len = %d\n",callid_suffix_len); |
|
269 |
- DBG("DEBUG: NEW CALLID:%.*s[%d]:\n", callid_s.len, callid_s.s |
|
270 |
- , callid_s.len); |
|
271 |
- new_cell = build_cell( NULL ) ; |
|
272 |
- if (!new_cell) { |
|
273 |
- ret=E_OUT_OF_MEM; |
|
274 |
- LOG(L_ERR, "ERROR: t_uac: short of cell shmem\n"); |
|
275 |
- goto error00; |
|
276 |
- } |
|
277 |
- new_cell->completion_cb=completion_cb; |
|
278 |
- new_cell->cbp=cbp; |
|
279 |
- /* cbp is installed -- tell error handling bellow not to free it */ |
|
280 |
- cbp=0; |
|
281 |
- new_cell->is_invite=msg_type->len==INVITE_LEN |
|
282 |
- && memcmp(msg_type->s, INVITE, INVITE_LEN)==0; |
|
283 |
- new_cell->local=1; |
|
284 |
- new_cell->kr=REQ_FWDED; |
|
285 |
- |
|
286 |
- |
|
287 |
- request=&new_cell->uac[branch].request; |
|
288 |
- request->dst.to=to; |
|
289 |
- request->dst.send_sock=send_sock; |
|
290 |
- request->dst.proto=proto; |
|
291 |
- request->dst.proto_reserved1=0; /* no special connection required */ |
|
292 |
- |
|
293 |
- /* need to put in table to calculate label which is needed for printing */ |
|
294 |
- LOCK_HASH(new_cell->hash_index); |
|
295 |
- insert_into_hash_table_unsafe( new_cell ); |
|
296 |
- UNLOCK_HASH(new_cell->hash_index); |
|
297 |
- |
|
298 |
- if (from) dummy_from=*from; else { dummy_from.s=0; dummy_from.len=0; } |
|
299 |
- /* calculate from tag from callid */ |
|
300 |
- crcitt_string_array(&from_tag[MD5_LEN+1], &callid_s, 1 ); |
|
301 |
- fromtag.s=from_tag; fromtag.len=FROM_TAG_LEN; |
|
302 |
- buf=build_uac_request( *msg_type, *dst, |
|
303 |
- dummy_from, fromtag, |
|
304 |
- DEFAULT_CSEQ, callid_s, |
|
305 |
- *headers, *body, branch, |
|
306 |
- new_cell, /* t carries hash_index, label, md5, |
|
307 |
- uac[].send_sock and other pieces of |
|
308 |
- information needed to print a message*/ |
|
309 |
- &req_len ); |
|
310 |
- if (!buf) { |
|
311 |
- ret=E_OUT_OF_MEM; |
|
312 |
- LOG(L_ERR, "ERROR: t_uac: short of req shmem\n"); |
|
313 |
- goto error01; |
|
314 |
- } |
|
315 |
- new_cell->method.s=buf;new_cell->method.len=msg_type->len; |
|
316 |
- |
|
317 |
- |
|
318 |
- request->buffer = buf; |
|
319 |
- request->buffer_len = req_len; |
|
320 |
- new_cell->nr_of_outgoings++; |
|
321 |
- |
|
322 |
- |
|
323 |
- proxy->tx++; |
|
324 |
- proxy->tx_bytes+=req_len; |
|
325 |
- |
|
326 |
- if (SEND_BUFFER( request)==-1) { |
|
327 |
- LOG(L_ERR, "ERROR: t_uac: UAC sending to %.*s failed\n", |
|
328 |
- dst->len, dst->s ); |
|
329 |
- proxy->errors++; |
|
330 |
- proxy->ok=0; |
|
331 |
- } |
|
332 |
- start_retr( request ); |
|
333 |
- |
|
334 |
- /* success */ |
|
335 |
- return 1; |
|
336 |
- |
|
337 |
-error01: |
|
338 |
- LOCK_HASH(new_cell->hash_index); |
|
339 |
- remove_from_hash_table_unsafe( new_cell ); |
|
340 |
- UNLOCK_HASH(new_cell->hash_index); |
|
341 |
- free_cell(new_cell); |
|
342 |
-error00: |
|
343 |
- free_proxy( proxy ); |
|
344 |
- free( proxy ); |
|
345 |
-done: |
|
346 |
- /* if we did not install cbp, release it now */ |
|
347 |
- if (cbp) shm_free(cbp); |
|
348 |
- return ser_error=ret; |
|
349 |
-} |
|
350 |
-#endif |
|
351 |
- |
|
352 | 203 |
static struct socket_info *uri2sock( str *uri, union sockaddr_union *to_su, |
353 | 204 |
int proto ) |
354 | 205 |
{ |
... | ... |
@@ -627,195 +478,6 @@ static void fifo_callback( struct cell *t, struct sip_msg *reply, |
627 | 478 |
DBG("DEBUG: fifo_callback sucesssfuly completed\n"); |
628 | 479 |
} |
629 | 480 |
|
630 |
-#ifndef DEPRECATE_OLD_STUFF |
|
631 |
- |
|
632 |
-/* to be obsoleted in favor of fifo_uac_from */ |
|
633 |
-int fifo_uac( FILE *stream, char *response_file ) |
|
634 |
-{ |
|
635 |
- str sm, sh, sb, sd; /* method, header, body, dst(outbound) */ |
|
636 |
- char method[MAX_METHOD]; /* read buffers for these ... */ |
|
637 |
- char header[MAX_HEADER]; |
|
638 |
- char body[MAX_BODY]; |
|
639 |
- char dst[MAX_DST]; |
|
640 |
- char *shmem_file; |
|
641 |
- int fn_len; |
|
642 |
- int ret; |
|
643 |
- int sip_error; |
|
644 |
- char err_buf[MAX_REASON_LEN]; |
|
645 |
- |
|
646 |
- sm.s=method; sh.s=header; sb.s=body; sd.s=dst; |
|
647 |
- if (!read_line(method, MAX_METHOD, stream,&sm.len)||sm.len==0) { |
|
648 |
- /* line breaking must have failed -- consume the rest |
|
649 |
- and proceed to a new request |
|
650 |
- */ |
|
651 |
- LOG(L_ERR, "ERROR: fifo_uac: method expected\n"); |
|
652 |
- fifo_reply(response_file, |
|
653 |
- "400 fifo_uac: method expected"); |
|
654 |
- return 1; |
|
655 |
- } |
|
656 |
- DBG("DEBUG: fifo_uac: method: %.*s\n", sm.len, method ); |
|
657 |
- if (!read_line(dst, MAX_DST, stream, &sd.len)||sd.len==0) { |
|
658 |
- fifo_reply(response_file, |
|
659 |
- "400 fifo_uac: destination expected\n"); |
|
660 |
- LOG(L_ERR, "ERROR: fifo_uac: destination expected\n"); |
|
661 |
- return 1; |
|
662 |
- } |
|
663 |
- DBG("DEBUG: fifo_uac: dst: %.*s\n", sd.len, dst ); |
|
664 |
- /* now read header fields line by line */ |
|
665 |
- if (!read_line_set(header, MAX_HEADER, stream, &sh.len)) { |
|
666 |
- fifo_reply(response_file, |
|
667 |
- "400 fifo_uac: HFs expected\n"); |
|
668 |
- LOG(L_ERR, "ERROR: fifo_uac: header fields expected\n"); |
|
669 |
- return 1; |
|
670 |
- } |
|
671 |
- DBG("DEBUG: fifo_uac: header: %.*s\n", sh.len, header ); |
|
672 |
- /* and eventually body */ |
|
673 |
- if (!read_body(body, MAX_BODY, stream, &sb.len)) { |
|
674 |
- fifo_reply(response_file, |
|
675 |
- "400 fifo_uac: body expected\n"); |
|
676 |
- LOG(L_ERR, "ERROR: fifo_uac: body expected\n"); |
|
677 |
- return 1; |
|
678 |
- } |
|
679 |
- DBG("DEBUG: fifo_uac: body: %.*s\n", sb.len, body ); |
|
680 |
- DBG("DEBUG: fifo_uac: EoL -- proceeding to transaction creation\n"); |
|
681 |
- /* we got it all, initiate transaction now! */ |
|
682 |
- if (response_file) { |
|
683 |
- fn_len=strlen(response_file)+1; |
|
684 |
- shmem_file=shm_malloc(fn_len); |
|
685 |
- if (shmem_file==0) { |
|
686 |
- LOG(L_ERR, "ERROR: fifo_uac: no shmem\n"); |
|
687 |
- fifo_reply(response_file, |
|
688 |
- "500 fifo_uac: no shmem for shmem_file\n"); |
|
689 |
- return 1; |
|
690 |
- } |
|
691 |
- memcpy(shmem_file, response_file, fn_len ); |
|
692 |
- } else { |
|
693 |
- shmem_file=0; |
|
694 |
- } |
|
695 |
- ret=t_uac(&sm,&sd, PROTO_UDP,&sh,&sb, 0 /* default from */, |
|
696 |
- fifo_callback,shmem_file,0 /* no dialog */); |
|
697 |
- if (ret>0) { |
|
698 |
- if (err2reason_phrase(ret, &sip_error, err_buf, |
|
699 |
- sizeof(err_buf), "FIFO/UAC" ) > 0 ) |
|
700 |
- { |
|
701 |
- fifo_reply(response_file, "500 FIFO/UAC error: %d\n", |
|
702 |
- ret ); |
|
703 |
- } else { |
|
704 |
- fifo_reply(response_file, err_buf ); |
|
705 |
- } |
|
706 |
- } |
|
707 |
- return 1; |
|
708 |
-} |
|
709 |
- |
|
710 |
- |
|
711 |
-/* syntax: |
|
712 |
- |
|
713 |
- :t_uac_from:[file] EOL |
|
714 |
- method EOL |
|
715 |
- [from] EOL (if none, server's default from is taken) |
|
716 |
- dst EOL (put in r-uri and To) |
|
717 |
- [CR-LF separated HFs]* EOL |
|
718 |
- EOL |
|
719 |
- [body] EOL |
|
720 |
- EOL |
|
721 |
- |
|
722 |
-*/ |
|
723 |
- |
|
724 |
-int fifo_uac_from( FILE *stream, char *response_file ) |
|
725 |
-{ |
|
726 |
- char method[MAX_METHOD]; |
|
727 |
- char header[MAX_HEADER]; |
|
728 |
- char body[MAX_BODY]; |
|
729 |
- char dst[MAX_DST]; |
|
730 |
- char from[MAX_FROM]; |
|
731 |
- str sm, sh, sb, sd, sf; |
|
732 |
- char *shmem_file; |
|
733 |
- int fn_len; |
|
734 |
- int ret; |
|
735 |
- int sip_error; |
|
736 |
- char err_buf[MAX_REASON_LEN]; |
|
737 |
- int err_ret; |
|
738 |
- |
|
739 |
- sm.s=method; sh.s=header; sb.s=body; sd.s=dst;sf.s=from; |
|
740 |
- |
|
741 |
- if (!read_line(method, MAX_METHOD, stream,&sm.len)||sm.len==0) { |
|
742 |
- /* line breaking must have failed -- consume the rest |
|
743 |
- and proceed to a new request |
|
744 |
- */ |
|
745 |
- LOG(L_ERR, "ERROR: fifo_uac: method expected\n"); |
|
746 |
- fifo_reply(response_file, |
|
747 |
- "400 fifo_uac: method expected"); |
|
748 |
- return 1; |
|
749 |
- } |
|
750 |
- DBG("DEBUG: fifo_uac: method: %.*s\n", sm.len, method ); |
|
751 |
- if (!read_line(from, MAX_FROM, stream, &sf.len)) { |
|
752 |
- fifo_reply(response_file, |
|
753 |
- "400 fifo_uac: from expected\n"); |
|
754 |
- LOG(L_ERR, "ERROR: fifo_uac: from expected\n"); |
|
755 |
- return 1; |
|
756 |
- } |
|
757 |
- DBG("DEBUG: fifo_uac: from: %.*s\n", sf.len, from); |
|
758 |
- if (!read_line(dst, MAX_DST, stream, &sd.len)||sd.len==0) { |
|
759 |
- fifo_reply(response_file, |
|
760 |
- "400 fifo_uac: destination expected\n"); |
|
761 |
- LOG(L_ERR, "ERROR: fifo_uac: destination expected\n"); |
|
762 |
- return 1; |
|
763 |
- } |
|
764 |
- DBG("DEBUG: fifo_uac: dst: %.*s\n", sd.len, dst ); |
|
765 |
- /* now read header fields line by line */ |
|
766 |
- if (!read_line_set(header, MAX_HEADER, stream, &sh.len)) { |
|
767 |
- fifo_reply(response_file, |
|
768 |
- "400 fifo_uac: HFs expected\n"); |
|
769 |
- LOG(L_ERR, "ERROR: fifo_uac: header fields expected\n"); |
|
770 |
- return 1; |
|
771 |
- } |
|
772 |
- DBG("DEBUG: fifo_uac: header: %.*s\n", sh.len, header ); |
|
773 |
- /* and eventually body */ |
|
774 |
- if (!read_body(body, MAX_BODY, stream, &sb.len)) { |
|
775 |
- fifo_reply(response_file, |
|
776 |
- "400 fifo_uac: body expected\n"); |
|
777 |
- LOG(L_ERR, "ERROR: fifo_uac: body expected\n"); |
|
778 |
- return 1; |
|
779 |
- } |
|
780 |
- DBG("DEBUG: fifo_uac: body: %.*s\n", sb.len, body ); |
|
781 |