2016-11-12 2 views
0

私は、gmimeライブラリのcバージョンを使用しています。すでにマルチパート形式になっているようなコンテンツの解析と抽出に問題があります。 gmimeは単にGMimeマルチパートコンテンツ

g_mime_multipart_get_part(mimeMessage, 0) 

を行うことが石鹸-XMLの一部を返すように正しくマルチパートを構築する方法を見つけ出すだろうであるように私は、コンテンツを解析すると思いました。明らかに私は間違っていて、mimeとgmimeライブラリについての私の限られた理解は私を殺しています。手伝ってください。よろしくお願いします。以下

GMimeStream * mimeStream = g_mime_stream_mem_new_with_buffer(incoming, n); 
GMimeParser * mimeParser = g_mime_parser_new_with_stream(mimeStream); 
g_object_unref(mimeStream); 
GMimeMessage * mimeMessage = g_mime_parser_construct_message(mimeParser); 
g_object_unref(mimeParser); 

** RAWコンテンツ*それは不完全だからGMimeはそれを解析することはできません

------=_Part_5896175_1217116888.1478087584633 
Content-Type: text/xml 

<soap-env:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
... 
</soap-env:Envelope> 
------=_Part_5896175_1217116888.1478087584633 
Content-Type: multipart/related;Start="<smil>";Type="application/smil"; 
    boundary="----=_Part_5896174_292278572.1478087584547" 
Content-ID: /mms/mm7/mm7client 

------=_Part_5896174_292278572.1478087584547 
Content-Type: application/smil;Name=smil.xml 
Content-Transfer-Encoding: 7bit 
Content-ID:<smil> 
Content-Location:smil.xml 

<smil><head><layout><root-layout width="320px" height="480px"/><region id="Text" left="0" top="320" width="320px" height="160px" fit="meet"/></layout></head><body><par dur="0ms"><text src="text_0.txt" region="Text"/></par></body></smil> 
------=_Part_5896174_292278572.1478087584547 
Content-Type: text/plain;Name=text_0.txt;Charset=utf-8 
Content-Transfer-Encoding: 7bit 
Content-ID:<text_0> 
Content-Location:text_0.txt 

Your MMS was read 02 Nov 2016 13:53 
------=_Part_5896174_292278572.1478087584547-- 

------=_Part_5896175_1217116888.1478087584633-- 

答えて

0

。コンテンツが境界を定義するContent-Typeヘッダーで始まらない場合、パーサーはマルチパーティー境界が何であるかをどのように知ることができますか?