merge "default" into JSON-54 JSON-54
authorRoker <roker@pep-project.org>
Fri, 06 Apr 2018 07:40:31 +0200
branchJSON-54
changeset 4593f1502a66662
parent 443 bcc161d4cf1f
parent 456 84d11d4b6adb
child 622 c5e9e54724ad
merge "default" into JSON-54
     1.1 --- a/server/ev_server.cc	Tue Mar 27 15:04:38 2018 +0200
     1.2 +++ b/server/ev_server.cc	Fri Apr 06 07:40:31 2018 +0200
     1.3 @@ -57,6 +57,10 @@
     1.4  		FP( "Message API", new Separator ),
     1.5  		FP( "MIME_encrypt_message", new Func<PEP_STATUS, In<PEP_SESSION, false>, In<c_string>, In<size_t>, In<stringlist_t*>,
     1.6  			Out<char*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &MIME_encrypt_message ) ),
     1.7 +		FP( "MIME_encrypt_message_for_self", new Func<PEP_STATUS, In<PEP_SESSION, false>, 
     1.8 +			In<pEp_identity*>, In<c_string>, In<size_t>, In<stringlist_t*>,
     1.9 +			Out<char*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &MIME_encrypt_message_for_self ) ),
    1.10 +			
    1.11  		FP( "MIME_decrypt_message", new Func<PEP_STATUS, In<PEP_SESSION, false>, In<c_string>, In<size_t>,
    1.12  			Out<char*>, Out<stringlist_t*>, Out<PEP_rating>, Out<PEP_decrypt_flags_t>>( &MIME_decrypt_message ) ),
    1.13  		
    1.14 @@ -66,6 +70,9 @@
    1.15  		FP( "stopKeyserverLookup",  new Func<void>( &JsonAdapter::stopKeyserverLookup ) ),
    1.16  		
    1.17  		FP( "encrypt_message", new Func<PEP_STATUS, In<PEP_SESSION, false>, In<message*>, In<stringlist_t*>, Out<message*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &encrypt_message ) ),
    1.18 +		FP( "encrypt_message_for_self", new Func<PEP_STATUS, In<PEP_SESSION, false>,
    1.19 +			In<pEp_identity*>, In<message*>, In<stringlist_t*>, Out<message*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &encrypt_message_for_self ) ),
    1.20 +		
    1.21  		FP( "decrypt_message", new Func<PEP_STATUS, In<PEP_SESSION, false>, In<message*>, Out<message*>, Out<stringlist_t*>, Out<PEP_rating>, Out<PEP_decrypt_flags_t>>(  &decrypt_message ) ),
    1.22  		FP( "outgoing_message_rating", new Func<PEP_STATUS, In<PEP_SESSION,false>, In<message*>, Out<PEP_rating>>( &outgoing_message_rating ) ),
    1.23  		FP( "identity_rating" , new Func<PEP_STATUS, In<PEP_SESSION,false>, In<pEp_identity*>, Out<PEP_rating>>( &identity_rating) ),
     2.1 --- a/server/main.cc	Tue Mar 27 15:04:38 2018 +0200
     2.2 +++ b/server/main.cc	Fri Apr 06 07:40:31 2018 +0200
     2.3 @@ -58,8 +58,15 @@
     2.4  	;
     2.5  	
     2.6  	po::variables_map vm;
     2.7 -	po::store(po::parse_command_line(argc, argv, desc), vm);
     2.8 -	po::notify(vm);
     2.9 +	
    2.10 +	try{
    2.11 +		po::store(po::parse_command_line(argc, argv, desc), vm);
    2.12 +		po::notify(vm);
    2.13 +	}catch(const po::error& e)
    2.14 +	{
    2.15 +		std::cerr << "Cannot parse command line: " << e.what() << "\n\n" << desc << std::endl;
    2.16 +		return 2;
    2.17 +	}
    2.18  	
    2.19  	if (vm.count("help"))
    2.20  	{
    2.21 @@ -112,7 +119,7 @@
    2.22  	ja.Log() << "Good bye. :-)" << std::endl;
    2.23  	JsonAdapter::global_shutdown();
    2.24  }
    2.25 -catch (std::exception const &e)
    2.26 +catch(std::exception const& e)
    2.27  {
    2.28  	std::cerr << "Exception caught in main(): \"" << e.what() << "\"" << std::endl;
    2.29  	return 1;
     3.1 --- a/server/server_version.cc	Tue Mar 27 15:04:38 2018 +0200
     3.2 +++ b/server/server_version.cc	Fri Apr 06 07:40:31 2018 +0200
     3.3 @@ -59,7 +59,8 @@
     3.4  //const ServerVersion sv{0, 12, 0, version_name};  // rename mis-spelled undo_last_mitrust() into undo_last_mistrust()
     3.5  //const ServerVersion sv{0, 12, 1, version_name};  // add assert_utf8() for every string to/from the Engine (except blobdata)
     3.6  //const ServerVersion sv{0, 12, 2, version_name};  // fix the fork() problem on MacOS. daemonize() now got a function parameter.
     3.7 -const ServerVersion sv(0,13,0);  // add package_version, rename "version" into "api_version" in ServerVersion, add versions from the Engine, too
     3.8 +//const ServerVersion sv(0,13,0);  // add package_version, rename "version" into "api_version" in ServerVersion, add versions from the Engine, too
     3.9 +const ServerVersion sv(0,13,1);  // JSON-91: add MIME_encrypt_message_for_self() and encrypt_message_for_self()
    3.10  
    3.11  } // end of anonymous namespace
    3.12  ////////////////////////////////////////////////////////////////////////////