Skip to content

Commit

Permalink
Replace chars so users can compile with non-ASCII code page
Browse files Browse the repository at this point in the history
  • Loading branch information
damonbarry committed Dec 15, 2016
1 parent c28e9ee commit 8204e12
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Third Party Notices for Azure Amqp library project

This project incorporates material from the project(s) listed below (collectively, Third Party Code).
This project incorporates material from the project(s) listed below (collectively, "Third Party Code").
Microsoft Corporation is not the original author of the Third Party Code.
The original copyright notice and license, under which Microsoft Corporation received such Third Party Code,
are set out below. This Third Party Code is licensed to you under their original license terms set forth below.
Expand Down
1 change: 0 additions & 1 deletion devdoc/amqp_frame_codec_requirements.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#amqp_frame_codec requirements



##Overview

amqp_frame_codec is module that encodes/decodes AMQP frames per the AMQP ISO.
Expand Down
4 changes: 2 additions & 2 deletions devdoc/sasl_frame_codec_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SASL performatives are framed as per Part 2: section 2.3. **SRS_SASL_FRAME_CODEC

Figure 5.5: SASL Frame

**SRS_SASL_FRAME_CODEC_01_008: [**The maximum size of a SASL frame is defined by MIN-MAX-FRAME-SIZE.**]** There is no mechanism within the SASL negotiation to negotiate a different size. **SRS_SASL_FRAME_CODEC_01_009: [**The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides=sasl-frame.**]** **SRS_SASL_FRAME_CODEC_01_010: [**Receipt of an empty frame is an irrecoverable error.**]**
**SRS_SASL_FRAME_CODEC_01_008: [**The maximum size of a SASL frame is defined by MIN-MAX-FRAME-SIZE.**]** There is no mechanism within the SASL negotiation to negotiate a different size. **SRS_SASL_FRAME_CODEC_01_009: [**The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides="sasl-frame".**]** **SRS_SASL_FRAME_CODEC_01_010: [**Receipt of an empty frame is an irrecoverable error.**]**

##ISO section (send)

Expand All @@ -86,5 +86,5 @@ SASL performatives are framed as per Part 2: section 2.3. **SRS_SASL_FRAME_CODEC

Figure 5.5: SASL Frame

**SRS_SASL_FRAME_CODEC_01_016: [**The maximum size of a SASL frame is defined by MIN-MAX-FRAME-SIZE.**]** There is no mechanism within the SASL negotiation to negotiate a different size. **SRS_SASL_FRAME_CODEC_01_047: [**The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides=sasl-frame.**]** Receipt of an empty frame is an irrecoverable error.
**SRS_SASL_FRAME_CODEC_01_016: [**The maximum size of a SASL frame is defined by MIN-MAX-FRAME-SIZE.**]** There is no mechanism within the SASL negotiation to negotiate a different size. **SRS_SASL_FRAME_CODEC_01_047: [**The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides="sasl-frame".**]** Receipt of an empty frame is an irrecoverable error.

4 changes: 2 additions & 2 deletions devdoc/saslclientio_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ When a frame is indicated as received by sasl_frame_codec it shall be processed
##ISO section
**SRS_SASLCLIENTIO_01_001: [**To establish a SASL layer, each peer MUST start by sending a protocol header.**]**
**SRS_SASLCLIENTIO_01_002: [**The protocol header consists of the upper case ASCII letters “AMQP” followed by a protocol id of three, followed by three unsigned bytes representing the major, minor, and revision of the specification version (currently 1 (SASL-MAJOR), 0 (SASLMINOR), 0 (SASL-REVISION)).**]** In total this is an 8-octet sequence:
**SRS_SASLCLIENTIO_01_002: [**The protocol header consists of the upper case ASCII letters "AMQP" followed by a protocol id of three, followed by three unsigned bytes representing the major, minor, and revision of the specification version (currently 1 (SASL-MAJOR), 0 (SASLMINOR), 0 (SASL-REVISION)).**]** In total this is an 8-octet sequence:
...
Expand Down Expand Up @@ -257,7 +257,7 @@ initial-response security response data
hostname the name of the target host
**SRS_SASLCLIENTIO_01_049: [**The DNS name of the host (either fully qualified or relative) to which the sending peer is connecting.**]**
**SRS_SASLCLIENTIO_01_050: [**It is not mandatory to provide the hostname.**]** If no hostname is provided the receiving peer SHOULD select a default based on its own configuration.
This field can be used by AMQP proxies to determine the correct back-end service to connect the client to, and to determine the domain to validate the client’s credentials against.
This field can be used by AMQP proxies to determine the correct back-end service to connect the client to, and to determine the domain to validate the client's credentials against.
**SRS_SASLCLIENTIO_01_051: [**This field might already have been specified by the server name indication extension as described in RFC-4366 [RFC4366**]**, if a TLS layer is used, in which case this field SHOULD either be null or contain the same value.] It is undefined what a different value to those already specified means.
5.3.3.3 SASL Challenge
Expand Down
10 changes: 5 additions & 5 deletions devdoc/session_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ Figure 2.27: Session End Sequence

2.5.3 Simultaneous End

Due to the potentially asynchronous nature of sessions, it is possible that both peers simultaneously decide to end a session. If this happens, it will appear to each peer as though their partner’s spontaneously initiated end frame is actually an answer to the peers initial end frame.
Due to the potentially asynchronous nature of sessions, it is possible that both peers simultaneously decide to end a session. If this happens, it will appear to each peer as though their partner's spontaneously initiated end frame is actually an answer to the peers initial end frame.

...

Figure 2.28: Simultaneous Session End Sequence

2.5.4 Session Errors

**SRS_SESSION_01_010: [**When a session is unable to process input, it MUST indicate this by issuing an END with an appropriate error indicating the cause of the problem.**]** **SRS_SESSION_01_011: [**It MUST then proceed to discard all incoming frames from the remote endpoint until receiving the remote endpoint’s corresponding end frame.**]**
**SRS_SESSION_01_010: [**When a session is unable to process input, it MUST indicate this by issuing an END with an appropriate error indicating the cause of the problem.**]** **SRS_SESSION_01_011: [**It MUST then proceed to discard all incoming frames from the remote endpoint until receiving the remote endpoint's corresponding end frame.**]**

...

Expand All @@ -169,7 +169,7 @@ END SENT In the END SENT state, the session endpoint has an entry in the incomin

END RCVD In the END RCVD state, the session endpoint is assigned an outgoing channel number, but there is no entry in the incoming channel map. The endpoint MAY send frames, but cannot receive them.

DISCARDING The DISCARDING state is a variant of the END SENT state where the end is triggered by an error. In this case any incoming frames on the session MUST be silently discarded until the peer’s end frame is received.
DISCARDING The DISCARDING state is a variant of the END SENT state where the end is triggered by an error. In this case any incoming frames on the session MUST be silently discarded until the peer's end frame is received.

...

Expand All @@ -184,8 +184,8 @@ There is no obligation to retain a session endpoint after it transitions to the
**SRS_SESSION_01_015: [**incoming-window The incoming-window defines the maximum number of incoming transfer frames that the endpoint can currently receive.**]** This identifies a current maximum incoming transfer-id that can be computed by subtracting one from the sum of incoming-window and next-incomingid.
**SRS_SESSION_01_016: [**next-outgoing-id The next-outgoing-id is the transfer-id to assign to the next transfer frame.**]** **SRS_SESSION_01_017: [**The nextoutgoing-id MAY be initialized to an arbitrary value **]** and **SRS_SESSION_01_018: [**is incremented after each successive transfer according to RFC-1982 [RFC1982**]** serial number arithmetic.]
**SRS_SESSION_01_019: [**outgoing-window The outgoing-window defines the maximum number of outgoing transfer frames that the endpoint can currently send.**]** This identifies a current maximum outgoing transfer-id that can be computed by subtracting one from the sum of outgoing-window and next-outgoing-id.
**SRS_SESSION_01_020: [**remote-incoming-window The remote-incoming-window reflects the maximum number of outgoing transfers that can be sent without exceeding the remote endpoint’s incoming-window.**]****SRS_SESSION_01_021: [**This value MUST be decremented after every transfer frame is sent**]**,**SRS_SESSION_01_022: [**and recomputed when informed of the remote session endpoint state.**]**
**SRS_SESSION_01_023: [**remote-outgoing-window The remote-outgoing-window reflects the maximum number of incoming transfers that MAY arrive without exceeding the remote endpoint’s outgoing-window.**]****SRS_SESSION_01_024: [**This value MUST be decremented after every incoming transfer frame is received**]**, **SRS_SESSION_01_025: [**and recomputed when informed of the remote session endpoint state.**]** When this window shrinks, it is an indication of outstanding transfers. Settling outstanding transfers can cause the window to grow.
**SRS_SESSION_01_020: [**remote-incoming-window The remote-incoming-window reflects the maximum number of outgoing transfers that can be sent without exceeding the remote endpoint's incoming-window.**]****SRS_SESSION_01_021: [**This value MUST be decremented after every transfer frame is sent**]**,**SRS_SESSION_01_022: [**and recomputed when informed of the remote session endpoint state.**]**
**SRS_SESSION_01_023: [**remote-outgoing-window The remote-outgoing-window reflects the maximum number of incoming transfers that MAY arrive without exceeding the remote endpoint's outgoing-window.**]****SRS_SESSION_01_024: [**This value MUST be decremented after every incoming transfer frame is received**]**, **SRS_SESSION_01_025: [**and recomputed when informed of the remote session endpoint state.**]** When this window shrinks, it is an indication of outstanding transfers. Settling outstanding transfers can cause the window to grow.
**SRS_SESSION_01_026: [**Once initialized, this state is updated by various events that occur in the lifespan of a session and its associated links:**]**
**SRS_SESSION_01_027: [**sending a transfer Upon sending a transfer, the sending endpoint will increment its next-outgoing-id**]**, **SRS_SESSION_01_062: [**decrement its remote-incoming-window**]** ,**SRS_SESSION_01_063: [**and MAY (depending on policy) decrement its outgoing window**]** .
**SRS_SESSION_01_028: [**receiving a transfer Upon receiving a transfer, the receiving endpoint will increment the next-incoming-id to match the implicit transfer-id of the incoming transfer plus one, as well as decrementing the remote-outgoing-window, and MAY (depending on policy) decrement its incoming-window.**]**
Expand Down
8 changes: 4 additions & 4 deletions src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/* Codes_SRS_CONNECTION_01_088: [Any data appearing beyond the protocol header MUST match the version indicated by the protocol header.] */
/* Codes_SRS_CONNECTION_01_015: [Implementations SHOULD NOT expect to be able to reuse open TCP sockets after close performatives have been exchanged.] */

/* Codes_SRS_CONNECTION_01_087: [The protocol header consists of the upper case ASCII letters AMQP followed by a protocol id of zero, followed by three unsigned bytes representing the major, minor, and revision of the protocol version (currently 1 (MAJOR), 0 (MINOR), 0 (REVISION)). In total this is an 8-octet sequence] */
/* Codes_SRS_CONNECTION_01_087: [The protocol header consists of the upper case ASCII letters "AMQP" followed by a protocol id of zero, followed by three unsigned bytes representing the major, minor, and revision of the protocol version (currently 1 (MAJOR), 0 (MINOR), 0 (REVISION)). In total this is an 8-octet sequence] */
static const unsigned char amqp_header[] = { 'A', 'M', 'Q', 'P', 0, 1, 0, 0 };

typedef enum RECEIVE_FRAME_STATE_TAG
Expand Down Expand Up @@ -94,7 +94,7 @@ static void connection_set_state(CONNECTION_INSTANCE* connection_instance, CONNE
connection_instance->on_connection_state_changed(connection_instance->on_connection_state_changed_callback_context, connection_state, previous_state);
}

/* Codes_SRS_CONNECTION_01_260: [Each endpoints on_connection_state_changed shall be called.] */
/* Codes_SRS_CONNECTION_01_260: [Each endpoint's on_connection_state_changed shall be called.] */
for (i = 0; i < connection_instance->endpoint_count; i++)
{
/* Codes_SRS_CONNECTION_01_259: [The callback_context passed in connection_create_endpoint.] */
Expand All @@ -106,7 +106,7 @@ static int send_header(CONNECTION_INSTANCE* connection_instance)
{
int result;

/* Codes_SRS_CONNECTION_01_093: [_ When the client opens a new socket connection to a server, it MUST send a protocol header with the clients preferred protocol version.] */
/* Codes_SRS_CONNECTION_01_093: [_ When the client opens a new socket connection to a server, it MUST send a protocol header with the client's preferred protocol version.] */
/* Codes_SRS_CONNECTION_01_104: [Sending the protocol header shall be done by using xio_send.] */
if (xio_send(connection_instance->io, amqp_header, sizeof(amqp_header), NULL, NULL) != 0)
{
Expand Down Expand Up @@ -421,7 +421,7 @@ static void close_connection_with_error(CONNECTION_INSTANCE* connection_instance
{
/* Codes_SRS_CONNECTION_01_213: [When passing the bytes to frame_codec fails, a CLOSE frame shall be sent and the state shall be set to DISCARDING.] */
/* Codes_SRS_CONNECTION_01_055: [DISCARDING The DISCARDING state is a variant of the CLOSE SENT state where the close is triggered by an error.] */
/* Codes_SRS_CONNECTION_01_010: [After writing this frame the peer SHOULD continue to read from the connection until it receives the partners close frame ] */
/* Codes_SRS_CONNECTION_01_010: [After writing this frame the peer SHOULD continue to read from the connection until it receives the partner's close frame ] */
connection_set_state(connection_instance, CONNECTION_STATE_DISCARDING);
}

Expand Down
2 changes: 1 addition & 1 deletion src/frame_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ int frame_codec_encode_frame(FRAME_CODEC_HANDLE frame_codec, uint8_t type, const
}

/* send padding bytes */
/* Codes_SRS_FRAME_CODEC_01_090: [If the type_specific_size 2 does not divide by 4, frame_codec_encode_frame shall pad the type_specific bytes with zeroes so that type specific data is according to the AMQP ISO.] */
/* Codes_SRS_FRAME_CODEC_01_090: [If the type_specific_size - 2 does not divide by 4, frame_codec_encode_frame shall pad the type_specific bytes with zeroes so that type specific data is according to the AMQP ISO.] */
unsigned char padding_bytes[] = { 0x00, 0x00, 0x00 };

/* Codes_SRS_FRAME_CODEC_01_088: [Encoded bytes shall be passed to the on_bytes_encoded callback.] */
Expand Down
6 changes: 3 additions & 3 deletions src/sasl_frame_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void amqp_value_decoded(void* context, AMQP_VALUE decoded_value)
}
else
{
/* Codes_SRS_SASL_FRAME_CODEC_01_009: [The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides=sasl-frame.] */
/* Codes_SRS_SASL_FRAME_CODEC_01_009: [The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides="sasl-frame".] */
if (!is_sasl_mechanisms_type_by_descriptor(descriptor) &&
!is_sasl_init_type_by_descriptor(descriptor) &&
!is_sasl_challenge_type_by_descriptor(descriptor) &&
Expand Down Expand Up @@ -120,7 +120,7 @@ static void frame_received(void* context, const unsigned char* type_specific, ui
}
}

/* Codes_SRS_SASL_FRAME_CODEC_01_009: [The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides=sasl-frame.] */
/* Codes_SRS_SASL_FRAME_CODEC_01_009: [The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides="sasl-frame".] */
if (frame_body_size > 0)
{
sasl_frame_codec_instance->decode_state = SASL_FRAME_DECODE_ERROR;
Expand Down Expand Up @@ -239,7 +239,7 @@ int sasl_frame_codec_encode_frame(SASL_FRAME_CODEC_HANDLE sasl_frame_codec, cons

if (((descriptor = amqpvalue_get_inplace_descriptor(sasl_frame_value)) == NULL) ||
(amqpvalue_get_ulong(descriptor, &sasl_frame_descriptor_ulong) != 0) ||
/* Codes_SRS_SASL_FRAME_CODEC_01_047: [The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides=sasl-frame.] */
/* Codes_SRS_SASL_FRAME_CODEC_01_047: [The frame body of a SASL frame MUST contain exactly one AMQP type, whose type encoding MUST have provides="sasl-frame".] */
(sasl_frame_descriptor_ulong < SASL_MECHANISMS) ||
(sasl_frame_descriptor_ulong > SASL_OUTCOME))
{
Expand Down
2 changes: 1 addition & 1 deletion src/saslclientio.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef struct SASL_CLIENT_IO_INSTANCE_TAG
unsigned int is_trace_on : 1;
} SASL_CLIENT_IO_INSTANCE;

/* Codes_SRS_SASLCLIENTIO_01_002: [The protocol header consists of the upper case ASCII letters AMQP followed by a protocol id of three, followed by three unsigned bytes representing the major, minor, and revision of the specification version (currently 1 (SASL-MAJOR), 0 (SASLMINOR), 0 (SASL-REVISION)).] */
/* Codes_SRS_SASLCLIENTIO_01_002: [The protocol header consists of the upper case ASCII letters "AMQP" followed by a protocol id of three, followed by three unsigned bytes representing the major, minor, and revision of the specification version (currently 1 (SASL-MAJOR), 0 (SASLMINOR), 0 (SASL-REVISION)).] */
/* Codes_SRS_SASLCLIENTIO_01_124: [SASL-MAJOR 1 major protocol version.] */
/* Codes_SRS_SASLCLIENTIO_01_125: [SASL-MINOR 0 minor protocol version.] */
/* Codes_SRS_SASLCLIENTIO_01_126: [SASL-REVISION 0 protocol revision.] */
Expand Down
Loading

0 comments on commit 8204e12

Please sign in to comment.