Re: Nokia 7210 Problems
Peter Löfman <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
I have tested the patch and it works very fine! Finally :-) I put my vote on having this included into cvs. /Peter Lofman >From: Stipe Tolj <[email protected]> >To: [email protected] >CC: [email protected], devel <[email protected]> >Subject: Re: Nokia 7210 Problems >Date: Wed, 15 Jan 2003 10:05:44 +0100 > >two questions: > >1. this patch hasn't been incorporated to the cvs tree right? has >anyone checked and voted for it? > >2. if we assume this works, what about breaking the HTTP specs for the >horizontal length of an HTTP header? If you pack 100 vertical HTTP >headers that contain one value each to one HTTP header with 100 >values, this may break the HTTP max line length? Are there any defind >limits? > >Stipe > > > > The problem is that kannel compose every header on its own line. > > > The solution for that - to pack http header > > > (create a comma separated list for http header values). > > > > > > I can propose patch for all who is interested in it. > > > It eliminates <HTTP/1.1 413 Request Entity Too Large> problem for me. > > > > > > (To apply this patch, go to kannel directory with Makefile and run: > > > patch -p0 < http_pack.patch ) > > > > > > >------------------------------------------------------------------------ > > > > > >--- ../devel_1.2.1_base/gwlib/http.c Thu Jan 2 12:04:16 2003 > > >+++ gwlib/http.c Mon Jan 6 15:56:58 2003 > > >@@ -2327,12 +2327,65 @@ > > > return new; > > > } > > > > > >+static int http_header_cmp(void *a, void *b) { > > >+ Octstr *header,*pat; > > >+ > > >+ header = a; > > >+ pat = b; > > >+ > > >+ if (octstr_ncompare(header, pat, octstr_len(pat)) == 0) { > > >+ return 1; > > >+ } > > >+ > > >+ return 0; > > >+} > > > > > > void http_header_pack(List *headers) > > > { > > >- gwlib_assert_init(); > > >- gw_assert(headers != NULL); > > >- /* XXX not implemented yet. */ > > >+ List *new_headers,*tmp_list; > > >+ Octstr *name,*name_col,*value,*curr,*raw_header; > > >+ int i; > > >+ > > >+ gwlib_assert_init(); > > >+ gw_assert(headers != NULL); > > >+ tmp_list = NULL; > > >+ > > >+ new_headers = http_create_empty_headers(); > > >+ > > >+ for (i = 0; i < list_len(headers); i++) { > > >+ http_header_get(headers, i, &name, &value); > > >+ name_col = octstr_duplicate(name); > > >+ octstr_append_cstr(name_col,":"); > > >+ if ((curr = list_search(new_headers, name_col, http_header_cmp)) >== NULL) { > > >+ http_header_add(new_headers, octstr_get_cstr(name), >octstr_get_cstr(value)); > > >+ } else { > > >+ if (octstr_len(curr) > 256) { > > >+ if (tmp_list == NULL) { > > >+ tmp_list = list_create(); > > >+ } > > >+ raw_header = octstr_duplicate(curr); > > >+ list_append(tmp_list,raw_header); > > >+ http_header_remove_all(new_headers, octstr_get_cstr(name)); > > >+ http_header_add(new_headers, octstr_get_cstr(name), >octstr_get_cstr(value)); > > >+ } else { > > >+ octstr_append_cstr(curr,", "); > > >+ octstr_append(curr,value); > > >+ } > > >+ } > > >+ octstr_destroy(name); > > >+ octstr_destroy(value); > > >+ octstr_destroy(name_col); > > >+ > > >+ } > > >+ > > >+ http_header_combine(headers, new_headers); > > >+ http_destroy_headers(new_headers); > > >+ if (tmp_list != NULL) { > > >+ while ((curr = list_extract_first(tmp_list)) != NULL) { > > >+ list_append(headers, curr); > > >+ } > > >+ list_destroy(tmp_list,NULL); > > >+ } > > > } > >[email protected] >------------------------------------------------------------------- >Wapme Systems AG > >Münsterstr. 248 >40470 Düsseldorf > >Tel: +49-211-74845-0 >Fax: +49-211-74845-299 > >E-Mail: [email protected] >Internet: http://www.wapme-systems.de >------------------------------------------------------------------- >wapme.net - wherever you are _________________________________________________________________ Senaste nytt från motormarknaden http://motor.msn.se/