~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle-2.0/handshake.cc

  • Committer: Brian Aker
  • Date: 2011-11-27 01:25:57 UTC
  • mto: This revision was merged to the branch mainline in revision 2465.
  • Revision ID: brian@tangent.org-20111127012557-vxph9h1v32v3m1bz
Move result over to being behind API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
572
572
 
573
573
drizzle_return_t drizzle_state_handshake_result_read(drizzle_con_st *con)
574
574
{
575
 
  drizzle_result_st result;
 
575
  drizzle_result_st *result;
576
576
 
577
577
  drizzle_log_debug(con->drizzle, "drizzle_state_handshake_result_read");
578
578
 
579
 
  if (drizzle_result_create(con, &result) == NULL)
 
579
  if ((result= drizzle_result_create(con)) == NULL)
580
580
  {
581
581
    return DRIZZLE_RETURN_MEMORY;
582
582
  }
583
583
 
584
 
  con->result= &result;
 
584
  con->result= result;
585
585
 
586
586
  drizzle_return_t ret= drizzle_state_result_read(con);
587
587
  if (drizzle_state_none(con))
588
588
  {
589
589
    if (ret == DRIZZLE_RETURN_OK)
590
590
    {
591
 
      if (drizzle_result_eof(&result))
 
591
      if (drizzle_result_eof(result))
592
592
      {
593
593
        drizzle_set_error(con->drizzle, "drizzle_state_handshake_result_read",
594
594
                         "old insecure authentication mechanism not supported");
595
595
        ret= DRIZZLE_RETURN_AUTH_FAILED;
596
596
      }
597
597
      else
 
598
      {
598
599
        con->options|= DRIZZLE_CON_READY;
 
600
      }
599
601
    }
600
602
  }
601
603
 
602
 
  drizzle_result_free(&result);
 
604
  drizzle_result_free(result);
603
605
 
604
606
  if (ret == DRIZZLE_RETURN_ERROR_CODE)
605
607
  {