[rabbitmq-discuss] amqp_login -> AMQP_RESPONSE_NONE (RabbitMQ C Client)

Frank Gönninger frank.goenninger at consequor.de
Thu Feb 18 23:46:05 GMT 2010


Hi Toni,

Am 18.02.2010 um 04:34 schrieb Tony Garnock-Jones:

> Hi Frank,
> 
> Thanks for posting the code. I think I see the problem.
> 
> Frank Gönninger wrote:
>>  amqp_login( psContext->psPIBAMQPConnection->psConnection,
>>              psContext->psPIBAMQPConnection->pcAMQPVirtualHost,
>>              psContext->psPIBAMQPConnection->nAMQPChannelMax,
>>              psContext->psPIBAMQPConnection->nAMQPFrameMax,
>>              psContext->psPIBAMQPConnection->nAMQPHeartbeat,
>>              psContext->psPIBAMQPConnection->nAMQPSaslMethod,
>>              psContext->psPIBAMQPConnection->pcAMQPUser,
>>              psContext->psPIBAMQPConnection->pcAMQPPassword );
>> 
>>  nRC = nCheckAMQPRpcReply( psContext, amqp_get_rpc_reply(),
>>                            __FILE__, __LINE__, __func__ );
> 
> The problem is that amqp_get_rpc_reply() is only intended for use with
> API operations that don't themselves return an amqp_rpc_reply_t. The
> amqp_login function does return an amqp_rpc_reply_t value, so you should
> be checking that instead of the result of amqp_get_rpc_reply(). It's
> confusing and undocumented, I know; I'm working on making it less
> confusing and improving the documentation too.

Ok, I see. Will change my code accordingly.

> 
> [Aside: everything after the SASL method argument to amqp_login is
> varargs, so if you're hard-coding the username and password in those
> positions, it makes sense to remove your nAMQPSaslMethod field and
> instead hardcode AMQP_SASL_METHOD_PLAIN.]
> 
> I've also changed the code just now to no longer ignore the result of
> amqp_login_inner. Thanks for the bug reports!
> 
> Regards,
>  Tony

Thank you for jumping in so quickly. I just *love* the support you guys are providing!

Cheers
  Frank

--
  C o n s e q u o r   C o n s u l t i n g   A G
  Frank Goenninger

  E-Mail: frank.goenninger at consequor.de
  Phone: +49 711 781 181-10
  Fax:   +49 711 781 181-11

  Consequor Consulting AG
  Liebknechstr. 33
  D-70565 Stuttgart

  Vorstand: Frank Gönninger (Vors.), Martin Melcher
  Aufsichtsratsvorsitzender: Dipl.-Kfm. Matthias Filbinger
  Sitz der Gesellschaft: 70565 Stuttgart, Deutschland
  Registergericht Amtsgericht Stuttgart HRB 727446






More information about the rabbitmq-discuss mailing list