rpms/jd/F-9 jd-2.0.1-cookie-change.patch,1.1,1.2

Mamoru Tasaka mtasaka at fedoraproject.org
Mon Sep 15 18:08:16 UTC 2008


Author: mtasaka

Update of /cvs/extras/rpms/jd/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21275/F-9

Modified Files:
	jd-2.0.1-cookie-change.patch 
Log Message:
fix patch (still need improvement, however it works)

jd-2.0.1-cookie-change.patch:

Index: jd-2.0.1-cookie-change.patch
===================================================================
RCS file: /cvs/extras/rpms/jd/F-9/jd-2.0.1-cookie-change.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jd-2.0.1-cookie-change.patch	15 Sep 2008 17:22:04 -0000	1.1
+++ jd-2.0.1-cookie-change.patch	15 Sep 2008 18:07:46 -0000	1.2
@@ -10,7 +10,7 @@
      std::string conf;
  
      bool ret;
-@@ -266,6 +267,16 @@
+@@ -266,6 +267,13 @@
      regex.exec( ".*<input +type=hidden +name=\"?hana\"? +value=\"?([^\"]*)\"?.*", str, 0, false, false );
      hana = MISC::remove_space( regex.str( 1 ) );
  
@@ -21,9 +21,58 @@
 +    regex.exec( ".*<input +type=hidden +name=\"[^\"]+\" +value=\"([^\"]+)\".*", str, 0, false, false );
 +    cookie_value = MISC::remove_space( regex.str( 1 ) );
 +
-+    if( m_msg.find( cookie_type + "=" ) == std::string::npos ) 
-+	m_msg += "&" + cookie_type + "=" + cookie_value;
-+
  #ifdef _DEBUG
      std::cout << "TITLE: [" << title << "]\n";
      std::cout << "2ch_X: [" << tag_2ch << "]\n";
+@@ -325,7 +333,7 @@
+             if( mdiag.get_chkbutton().get_active() ) CONFIG::set_always_write_ok( true );
+         }
+ 
+-        set_cookies_and_hana( SKELETON::Loadable::cookies(), hana );
++        set_cookies_and_hana( SKELETON::Loadable::cookies(), cookie_type, cookie_value );
+ 
+         ++m_count; // 永久ループ防止
+         post_msg();
+@@ -337,7 +345,7 @@
+     else if( m_count < 1 // 永久ループ防止
+              && ! m_subbbs && conf.find( "書き込み確認" ) != std::string::npos ){
+ 
+-        set_cookies_and_hana( SKELETON::Loadable::cookies(), hana );
++        set_cookies_and_hana( SKELETON::Loadable::cookies(), cookie_type, cookie_value );
+ 
+         // subbbs.cgi にポスト先を変更してもう一回ポスト
+         m_subbbs = true;
+@@ -367,15 +375,17 @@
+ //
+ // データベースにクッキーとhanaを登録
+ //
+-void Post::set_cookies_and_hana( const std::list< std::string >& cookies, const std::string& hana )
++void Post::set_cookies_and_hana( const std::list< std::string >& cookies, 
++	const std::string& cookie_type, const std::string& cookie_value )
+ {
++    std::string hana = "&" + cookie_type + "=" + cookie_value;
+     if( ! cookies.empty() ) DBTREE::board_set_list_cookies_for_write( m_url, cookies );
+ 
+     if( ! hana.empty() ){
+         DBTREE::board_set_hana_for_write( m_url, hana );
+ 
+         // 手抜き。後で直すこと
+-        if( m_msg.find( "hana=" ) == std::string::npos ) m_msg += "&hana=" + hana;
++        if( m_msg.find( cookie_type + "=" ) == std::string::npos ) m_msg += hana;
+     }
+ }
+ 
+Index: src/message/post.h
+===================================================================
+--- src/message/post.h	(revision 2342)
++++ src/message/post.h	(working copy)
+@@ -58,7 +58,8 @@
+         virtual void receive_data( const char* data, size_t size );
+         virtual void receive_finish();
+ 
+-        void set_cookies_and_hana( const std::list< std::string >& cookies, const std::string& hana );
++        void set_cookies_and_hana( const std::list< std::string >& cookies, 
++		const std::string& cookie_type, const std::string& cookie_value );
+     };
+     
+ }




More information about the fedora-extras-commits mailing list