Skip to content

Commit

Permalink
Merge bb4324d into e4c288f
Browse files Browse the repository at this point in the history
  • Loading branch information
manchicken committed Feb 8, 2020
2 parents e4c288f + bb4324d commit 5f6152d
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ MANIFEST
Net-AMQP-RabbitMQ-*.tar.*
.vagrant/
MANIFEST.bak
.DS_Store
*.sublime-*

.vstags
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
sudo: false
language: perl
perl:
- "5.30"
- "5.28"
- "5.26"
- "5.24"
Expand All @@ -15,6 +16,8 @@ perl:
os:
- linux
- osx
osx_image:
- "xcode11.3"
services: rabbitmq
before_install:
- $TRAVIS_BUILD_DIR/travis/before_install
Expand Down
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Revision history for perl module Net::AMQP::RabbitMQ

2.40005 - 2020-02-08
- Bumped rabbitmq-c version. - fixes #112

2.40004 - 2019-06-13
- Fixed tests failing if LWP::UserAgent installed but not LWP::Protocol::https - fixes #176

Expand Down
2 changes: 1 addition & 1 deletion RabbitMQ.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package Net::AMQP::RabbitMQ;
use strict;
use warnings;

our $VERSION = '2.40004';
our $VERSION = '2.40005';

use XSLoader;
XSLoader::load "Net::AMQP::RabbitMQ", $VERSION;
Expand Down
13 changes: 6 additions & 7 deletions RabbitMQ.xs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#endif

#include "amqp.h"
#include "amqp_socket.h"
#include "amqp_tcp_socket.h"
#include "amqp_ssl_socket.h"
/* For struct timeval */
Expand Down Expand Up @@ -113,7 +114,7 @@ SV* mq_table_to_hashref(amqp_table_t *table);
void die_on_error(pTHX_ int x, amqp_connection_state_t conn, char const *context) {
/* Handle socket errors */
if ( x == AMQP_STATUS_CONNECTION_CLOSED || x == AMQP_STATUS_SOCKET_ERROR ) {
amqp_socket_close( amqp_get_socket( conn ) );
amqp_socket_close( amqp_get_socket( conn ), AMQP_SC_FORCE );
Perl_croak(aTHX_ "%s failed because AMQP socket connection was closed.", context);
}
/* Handle everything else */
Expand All @@ -139,7 +140,7 @@ void die_on_amqp_error(pTHX_ amqp_rpc_reply_t x, amqp_connection_state_t conn, c
||
x.library_error == AMQP_STATUS_SOCKET_ERROR
) {
amqp_socket_close( amqp_get_socket( conn ) );
amqp_socket_close( amqp_get_socket( conn ), AMQP_SC_FORCE );
Perl_croak(aTHX_ "%s: failed since AMQP socket connection closed.\n", context);
}
/* Otherwise, give a more generic croak. */
Expand Down Expand Up @@ -1190,9 +1191,7 @@ net_amqp_rabbitmq_connect(conn, hostname, options)
Perl_croak(aTHX_ "error creating SSL socket");
}

// TODO
// change this to amqp_ssl_socket_set_verify_hostname when next rabbitmq lib
amqp_ssl_socket_set_verify( sock, (amqp_boolean_t)ssl_verify_host );
amqp_ssl_socket_set_verify_hostname( sock, (amqp_boolean_t)ssl_verify_host );

if ( ( ssl_cacert != NULL ) && strlen(ssl_cacert) ) {
if ( amqp_ssl_socket_set_cacert(sock, ssl_cacert) ) {
Expand Down Expand Up @@ -1779,7 +1778,7 @@ net_amqp_rabbitmq__publish(conn, channel, routing_key, body, options = NULL, pro

/* If the connection failed, blast the file descriptor! */
if ( rv == AMQP_STATUS_CONNECTION_CLOSED || rv == AMQP_STATUS_SOCKET_ERROR ) {
amqp_socket_close( amqp_get_socket( conn ) );
amqp_socket_close( amqp_get_socket( conn ), AMQP_SC_FORCE );
Perl_croak(aTHX_ "Publish failed because AMQP socket connection was closed.");
}

Expand Down Expand Up @@ -1863,7 +1862,7 @@ net_amqp_rabbitmq_disconnect(conn)
CODE:
if ( amqp_get_socket(conn) != NULL ) {
amqp_connection_close(conn, AMQP_REPLY_SUCCESS);
amqp_socket_close( amqp_get_socket( conn ) );
amqp_socket_close( amqp_get_socket( conn ), AMQP_SC_NONE );
}

Net::AMQP::RabbitMQ
Expand Down
1 change: 1 addition & 0 deletions amqp_openssl_bio.c
1 change: 1 addition & 0 deletions amqp_openssl_hostname_validation.c
2 changes: 1 addition & 1 deletion rabbitmq-c
Submodule rabbitmq-c updated 124 files
1 change: 1 addition & 0 deletions rabbitmq-include/amqp_openssl_bio.h
1 change: 1 addition & 0 deletions rabbitmq-include/amqp_openssl_hostname_validation.h
1 change: 1 addition & 0 deletions t/lib/NAR/Helper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ sub new {
$port = $ENV{MQSSLPORT} || 5671;
}
else {
Test::More::note( "non-ssl mode" );
$host = $ENV{MQHOST} if exists $ENV{MQHOST};
$username = $ENV{MQUSERNAME} if exists $ENV{MQUSERNAME};
$password = $ENV{MQPASSWORD} if exists $ENV{MQPASSWORD};
Expand Down

0 comments on commit 5f6152d

Please sign in to comment.