# How to display current section title in the header when a new chapter begins just on an odd page

I am using package fancyhdr to help me construct the headers of my book. The Editor want to me to add the chapter title to the header if the new chapter begins on a page whose number is even, and to add the section title to the header if the new chapter begins on a page whose number is odd. Then I modified the page-style "plain" as follows (just a test file):

 \documentclass[openany]{book}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}

\fancypagestyle{plain}{
\fancyhf{}
}

\begin{document}
\chapter{Test-1}
\section{test-section-1}
\newpage
\section{test-section-2}
\newpage
\section{test-section-3}
\newpage
\chapter{Test-2}
\section{test-section-4}
\end{document}


But I can only realize partially the specifications. If the new chapter begins on an even page, all the codes are OK, but if the new chapter begins on odd page, then it could not display the section title, but only the page number. Here is the screen-shoots:

1. New chapter page with ODD page number, need section title

2. even page, all things are OK

3. odd page, all things are OK

4. new chapter page with Even page number, all things are OK

Then I tried many methods. But at last I figured out a method, which is very complex, but it did work. I just only defined a new command, which is as follows:

  \newcommand{\headodd}[2]{\fancypagestyle{myplain}{%
\fancyhf{} %
\pagestyle{fancy}
%\hypersetup{
%   pdfborder={0 0 0},
%}
}
\thispagestyle{myplain}
}


Then I modified the main body into :

     \chapter{Test-1}